@roarkanalytics/sdk-mcp 4.44.2 → 4.44.6

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 (73) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client-headers.d.mts +2 -2
  3. package/client-headers.d.ts +2 -2
  4. package/client-headers.js +1 -1
  5. package/client-headers.mjs +1 -1
  6. package/directory-output-schemas.d.mts +139 -0
  7. package/directory-output-schemas.d.mts.map +1 -0
  8. package/directory-output-schemas.d.ts +139 -0
  9. package/directory-output-schemas.d.ts.map +1 -0
  10. package/directory-output-schemas.js +251 -0
  11. package/directory-output-schemas.js.map +1 -0
  12. package/directory-output-schemas.mjs +248 -0
  13. package/directory-output-schemas.mjs.map +1 -0
  14. package/directory-tools.d.mts +2 -0
  15. package/directory-tools.d.mts.map +1 -1
  16. package/directory-tools.d.ts +2 -0
  17. package/directory-tools.d.ts.map +1 -1
  18. package/directory-tools.js +253 -115
  19. package/directory-tools.js.map +1 -1
  20. package/directory-tools.mjs +252 -114
  21. package/directory-tools.mjs.map +1 -1
  22. package/docs-search-tool.d.mts +10 -3
  23. package/docs-search-tool.d.mts.map +1 -1
  24. package/docs-search-tool.d.ts +10 -3
  25. package/docs-search-tool.d.ts.map +1 -1
  26. package/docs-search-tool.js +36 -6
  27. package/docs-search-tool.js.map +1 -1
  28. package/docs-search-tool.mjs +34 -5
  29. package/docs-search-tool.mjs.map +1 -1
  30. package/http.d.mts.map +1 -1
  31. package/http.d.ts.map +1 -1
  32. package/http.js +8 -7
  33. package/http.js.map +1 -1
  34. package/http.mjs +9 -8
  35. package/http.mjs.map +1 -1
  36. package/oauth.d.mts +16 -1
  37. package/oauth.d.mts.map +1 -1
  38. package/oauth.d.ts +16 -1
  39. package/oauth.d.ts.map +1 -1
  40. package/oauth.js +24 -1
  41. package/oauth.js.map +1 -1
  42. package/oauth.mjs +22 -0
  43. package/oauth.mjs.map +1 -1
  44. package/options.d.mts +10 -0
  45. package/options.d.mts.map +1 -1
  46. package/options.d.ts +10 -0
  47. package/options.d.ts.map +1 -1
  48. package/options.js +29 -3
  49. package/options.js.map +1 -1
  50. package/options.mjs +27 -3
  51. package/options.mjs.map +1 -1
  52. package/package.json +11 -1
  53. package/server.d.mts.map +1 -1
  54. package/server.d.ts.map +1 -1
  55. package/server.js +8 -1
  56. package/server.js.map +1 -1
  57. package/server.mjs +8 -1
  58. package/server.mjs.map +1 -1
  59. package/src/client-headers.ts +1 -1
  60. package/src/directory-output-schemas.ts +318 -0
  61. package/src/directory-tools.ts +291 -99
  62. package/src/docs-search-tool.ts +42 -6
  63. package/src/http.ts +9 -7
  64. package/src/oauth.ts +28 -1
  65. package/src/options.ts +30 -3
  66. package/src/server.ts +9 -1
  67. package/src/types.ts +1 -0
  68. package/types.d.mts +1 -0
  69. package/types.d.mts.map +1 -1
  70. package/types.d.ts +1 -0
  71. package/types.d.ts.map +1 -1
  72. package/types.js.map +1 -1
  73. package/types.mjs.map +1 -1
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { Tool } from '@modelcontextprotocol/sdk/types.js';
4
- import { Metadata, McpRequestContext, asTextContentResult } from './types';
4
+ import { Metadata, McpRequestContext, ToolCallResult, asTextContentResult } from './types';
5
5
  import { getLogger } from './logger';
6
6
  import type { LocalDocsSearch } from './local-docs-search';
7
7
 
@@ -22,25 +22,43 @@ export const tool: Tool = {
22
22
  properties: {
23
23
  query: {
24
24
  type: 'string',
25
- description: 'The query to search for.',
25
+ description:
26
+ 'What to look up, in plain words: a task, method, or parameter, such as "create a persona" or "list calls by agent".',
26
27
  },
27
28
  language: {
28
29
  type: 'string',
29
- description: 'The language for the SDK to search for.',
30
+ description:
31
+ 'SDK language the signatures and examples are shown in. http returns the REST endpoints.',
30
32
  enum: ['http', 'python', 'go', 'typescript', 'javascript', 'terraform', 'ruby', 'java', 'kotlin'],
31
33
  },
32
34
  detail: {
33
35
  type: 'string',
34
- description: 'The amount of detail to return.',
36
+ description:
37
+ 'How much to return for each match: default gives a summary, verbose the full reference. When omitted, default.',
35
38
  enum: ['default', 'verbose'],
36
39
  },
37
40
  },
38
41
  required: ['query', 'language'],
39
42
  },
43
+ outputSchema: {
44
+ type: 'object',
45
+ properties: {
46
+ results: {
47
+ type: 'array',
48
+ description:
49
+ 'Matches, best first. A method match is an object with method, summary, description, endpoint, and, when known, example, params, and response; with detail verbose it is the full Markdown reference as a string. A documentation match is an object with content and source. When results were cut to fit, the first entry is a string saying how many are shown.',
50
+ items: {},
51
+ },
52
+ },
53
+ required: ['results'],
54
+ },
55
+ // Reads a fixed documentation corpus, so the result depends only on the input.
40
56
  annotations: {
41
57
  title: 'Search Roark docs',
42
58
  readOnlyHint: true,
43
59
  destructiveHint: false,
60
+ idempotentHint: true,
61
+ openWorldHint: false,
44
62
  },
45
63
  };
46
64
 
@@ -122,6 +140,24 @@ async function searchRemote(args: Record<string, unknown>, reqContext: McpReques
122
140
  return resultBody;
123
141
  }
124
142
 
143
+ /**
144
+ * The local index returns `{ results }`, and so does this tool, as structuredContent and as JSON
145
+ * text. The hosted search (`--docs-search-mode=stainless-api`) returns a body whose shape this
146
+ * package does not define: a body that already has a `results` array passes through, an array
147
+ * becomes `results`, and anything else becomes its only entry.
148
+ */
149
+ export const asResults = (results: unknown): ToolCallResult => {
150
+ const alreadyWrapped =
151
+ typeof results === 'object' &&
152
+ results !== null &&
153
+ Array.isArray((results as { results?: unknown }).results);
154
+ const body =
155
+ alreadyWrapped ?
156
+ { results: (results as { results: unknown[] }).results }
157
+ : { results: Array.isArray(results) ? results : [results] };
158
+ return { ...asTextContentResult(body), structuredContent: body };
159
+ };
160
+
125
161
  export const handler = async ({
126
162
  reqContext,
127
163
  args,
@@ -132,10 +168,10 @@ export const handler = async ({
132
168
  const body = args ?? {};
133
169
 
134
170
  if (_localSearch) {
135
- return asTextContentResult(await searchLocal(body));
171
+ return asResults(await searchLocal(body));
136
172
  }
137
173
 
138
- return asTextContentResult(await searchRemote(body, reqContext));
174
+ return asResults(await searchRemote(body, reqContext));
139
175
  };
140
176
 
141
177
  export default { metadata, tool, handler };
package/src/http.ts CHANGED
@@ -12,6 +12,7 @@ import { getLogger } from './logger';
12
12
  import { McpOptions, toolSurfaceFor } from './options';
13
13
  import {
14
14
  Connector,
15
+ oauthConfigForRequest,
15
16
  ORIGIN_CONNECTOR,
16
17
  protectedResourceMetadata,
17
18
  requireBearer,
@@ -55,7 +56,8 @@ const newServer = async ({
55
56
  let authOptions: Partial<ClientOptions>;
56
57
  if (mcpOptions.oauth) {
57
58
  const connector = connectorFrom(req);
58
- const authorized = requireBearer(req, mcpOptions.oauth, connector);
59
+ const oauth = oauthConfigForRequest(mcpOptions.oauth, req);
60
+ const authorized = requireBearer(req, oauth, connector);
59
61
  // Presence is not validity. Ask customer-api whether the token is still live, so a revoked or
60
62
  // expired one is answered with 401 + WWW-Authenticate here - the signal a client needs to
61
63
  // re-run the OAuth flow - rather than completing the handshake and failing later inside a
@@ -64,7 +66,7 @@ const newServer = async ({
64
66
  // The base URL is resolved the way the SDK resolves it, NOT defaulted to prod: this server is
65
67
  // launched without `clientOptions`, so on any stage but prod a prod default would check the
66
68
  // token against a server that never issued it and refuse every request.
67
- await requireLiveBearer(authorized.bearerToken, mcpOptions.oauth, connector, {
69
+ await requireLiveBearer(authorized.bearerToken, oauth, connector, {
68
70
  baseURL: resolveApiBaseUrl(clientOptions),
69
71
  });
70
72
  authOptions = authorized;
@@ -289,13 +291,13 @@ export const streamableHTTPApp = ({
289
291
  // served in remote OAuth mode.
290
292
  if (mcpOptions.oauth) {
291
293
  const oauth = mcpOptions.oauth;
292
- app.get('/.well-known/oauth-protected-resource', (_req, res) => {
293
- res.status(200).json(protectedResourceMetadata(oauth));
294
+ app.get('/.well-known/oauth-protected-resource', (req, res) => {
295
+ res.status(200).json(protectedResourceMetadata(oauthConfigForRequest(oauth, req)));
294
296
  });
295
297
  // The single connector. Its `resource` carries no project, which is what tells the
296
298
  // authorization server to mint a credential for the person rather than for one project.
297
- app.get('/.well-known/oauth-protected-resource/mcp', (_req, res) => {
298
- res.status(200).json(protectedResourceMetadata(oauth, { kind: 'mcp' }));
299
+ app.get('/.well-known/oauth-protected-resource/mcp', (req, res) => {
300
+ res.status(200).json(protectedResourceMetadata(oauthConfigForRequest(oauth, req), { kind: 'mcp' }));
299
301
  });
300
302
  app.get('/.well-known/oauth-protected-resource/mcp/:projectId', (req, res) => {
301
303
  const projectId = req.params['projectId'];
@@ -303,7 +305,7 @@ export const streamableHTTPApp = ({
303
305
  .status(200)
304
306
  .json(
305
307
  protectedResourceMetadata(
306
- oauth,
308
+ oauthConfigForRequest(oauth, req),
307
309
  typeof projectId === 'string' ? { kind: 'project', projectId } : undefined,
308
310
  ),
309
311
  );
package/src/oauth.ts CHANGED
@@ -17,8 +17,35 @@ import { readEnv } from './util';
17
17
  export type OAuthConfig = {
18
18
  /** Authorization server issuer, e.g. https://mcp-oauth.api.roark.ai */
19
19
  issuer: string;
20
- /** Public origin of this resource server, e.g. https://mcp.api.roark.ai; connector URLs are `<base>/mcp/<projectId>`. */
20
+ /** Public origin of this resource server, e.g. https://mcp.roark.ai; connector URLs are `<base>/mcp/<projectId>`. */
21
21
  resourceBaseUrl: string;
22
+ /**
23
+ * Other origins this server also answers on, e.g. https://mcp.api.roark.ai after a move to a
24
+ * new hostname. A request that arrives on one of them is described with that origin, so a
25
+ * client connected to the old URL keeps getting metadata that names the URL it used.
26
+ */
27
+ resourceAliases?: string[];
28
+ };
29
+
30
+ /**
31
+ * The config for one request: `resourceBaseUrl` becomes the origin the request arrived on when
32
+ * that origin is one of `resourceAliases`, and stays the canonical one otherwise.
33
+ *
34
+ * RFC 9728 has a client check that the `resource` in the metadata is the URL it connected to.
35
+ * Serving two hostnames with one fixed origin would fail that check on one of them. Only
36
+ * configured origins are reflected, so a forged Host header cannot name a resource we do not own.
37
+ */
38
+ export const oauthConfigForRequest = (config: OAuthConfig, req: Pick<IncomingMessage, 'headers'>) => {
39
+ const host = req.headers.host?.toLowerCase();
40
+ if (!host) return config;
41
+ const alias = config.resourceAliases?.find((origin) => {
42
+ try {
43
+ return new URL(origin).host.toLowerCase() === host;
44
+ } catch {
45
+ return false;
46
+ }
47
+ });
48
+ return alias ? { ...config, resourceBaseUrl: stripSlash(alias) } : config;
22
49
  };
23
50
 
24
51
  /** Thrown when a request cannot be authorized; carries the WWW-Authenticate value to return. */
package/src/options.ts CHANGED
@@ -160,6 +160,12 @@ export function parseCLIOptions(): CLIOptions {
160
160
  default: readEnv('MCP_OAUTH_RESOURCE_BASE_URL'),
161
161
  description: 'Public base URL of this resource server, used to build metadata and resource URLs.',
162
162
  })
163
+ .option('oauth-resource-aliases', {
164
+ type: 'string',
165
+ default: readEnv('MCP_OAUTH_RESOURCE_ALIASES'),
166
+ description:
167
+ 'Comma-separated origins this server also answers on, e.g. a previous hostname. Requests on them get metadata naming that origin.',
168
+ })
163
169
  .env('MCP_SERVER')
164
170
  .version(true)
165
171
  .help();
@@ -223,15 +229,36 @@ export function parseCLIOptions(): CLIOptions {
223
229
  * when either field is absent (legacy optional-bearer mode). Both the issuer and
224
230
  * this server's public base URL are required together.
225
231
  */
226
- const buildOAuthConfig = (argv: {
232
+ export const buildOAuthConfig = (argv: {
227
233
  oauthIssuer?: string | undefined;
228
234
  oauthResourceBaseUrl?: string | undefined;
235
+ oauthResourceAliases?: string | undefined;
229
236
  }): OAuthConfig | undefined => {
230
- const { oauthIssuer, oauthResourceBaseUrl } = argv;
237
+ const { oauthIssuer, oauthResourceBaseUrl, oauthResourceAliases } = argv;
231
238
  if (!oauthIssuer || !oauthResourceBaseUrl) {
232
239
  return undefined;
233
240
  }
234
- return { issuer: oauthIssuer, resourceBaseUrl: oauthResourceBaseUrl };
241
+ // Each alias is reduced to its origin, and a value that is not a URL stops the server: a typo
242
+ // would otherwise surface only as clients on that host failing the resource check.
243
+ const resourceAliases = (oauthResourceAliases ?? '')
244
+ .split(',')
245
+ .map((alias) => alias.trim())
246
+ .filter((alias) => alias.length > 0)
247
+ .map((alias, index) => {
248
+ try {
249
+ return new URL(alias).origin;
250
+ } catch {
251
+ // Names the position, not the value: this is printed at startup.
252
+ throw new Error(
253
+ `oauth-resource-aliases: entry ${index + 1} is not a URL. Give each alias as an origin, such as https://mcp.example.com.`,
254
+ );
255
+ }
256
+ });
257
+ return {
258
+ issuer: oauthIssuer,
259
+ resourceBaseUrl: oauthResourceBaseUrl,
260
+ ...(resourceAliases.length > 0 && { resourceAliases }),
261
+ };
235
262
  };
236
263
 
237
264
  const coerceArray = <T extends z.ZodTypeAny>(zodType: T) =>
package/src/server.ts CHANGED
@@ -32,8 +32,16 @@ export const newMcpServer = async ({
32
32
  new McpServer(
33
33
  {
34
34
  name: 'roarkanalytics_sdk_api',
35
+ title: 'Roark',
36
+ description:
37
+ 'Test and monitor voice and chat AI agents with Roark. Read calls, transcripts, metric scores, and simulation results, and set up agents, personas, and customer flows to run simulated calls against your agent.',
38
+ websiteUrl: 'https://roark.ai',
39
+ icons: [
40
+ { src: 'https://roark.ai/icon.svg', mimeType: 'image/svg+xml', sizes: ['any'] },
41
+ { src: 'https://roark.ai/icon.png', mimeType: 'image/png', sizes: ['512x512'] },
42
+ ],
35
43
  // A literal, not MCP_SERVER_VERSION: publish.yml checks dist/server.js for it.
36
- version: '4.44.2', // x-release-please-version
44
+ version: '4.44.6', // x-release-please-version
37
45
  },
38
46
  {
39
47
  // Directory mode does not fetch instructions. The hosted document tells a
package/src/types.ts CHANGED
@@ -39,6 +39,7 @@ export type ContentBlock = TextContentBlock | ImageContentBlock | AudioContentBl
39
39
 
40
40
  export type ToolCallResult = {
41
41
  content: ContentBlock[];
42
+ structuredContent?: Record<string, unknown>;
42
43
  isError?: boolean;
43
44
  };
44
45
 
package/types.d.mts CHANGED
@@ -29,6 +29,7 @@ type ResourceContentBlock = {
29
29
  export type ContentBlock = TextContentBlock | ImageContentBlock | AudioContentBlock | ResourceContentBlock;
30
30
  export type ToolCallResult = {
31
31
  content: ContentBlock[];
32
+ structuredContent?: Record<string, unknown>;
32
33
  isError?: boolean;
33
34
  };
34
35
  export type McpRequestContext = {
package/types.d.mts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAE3G,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd;;;;;;;;OAQG;IACH,OAAO,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C,GAAG,SAAS,CAAC;IACxD,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,aAAa,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CAC/D,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,EAC7B,UAAU,EACV,IAAI,GACL,EAAE;IACD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;CAC3C,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;AAE9B,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,OAAO,GAAG,cAAc,CASnE;AAED,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CA2BvF;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAU7D;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC"}
package/types.d.ts CHANGED
@@ -29,6 +29,7 @@ type ResourceContentBlock = {
29
29
  export type ContentBlock = TextContentBlock | ImageContentBlock | AudioContentBlock | ResourceContentBlock;
30
30
  export type ToolCallResult = {
31
31
  content: ContentBlock[];
32
+ structuredContent?: Record<string, unknown>;
32
33
  isError?: boolean;
33
34
  };
34
35
  export type McpRequestContext = {
package/types.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["src/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oCAAoC,CAAC;AAE1D,KAAK,gBAAgB,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EACJ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,GACD;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACP,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,oBAAoB,CAAC;AAE3G,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,KAAK,CAAC;IACd;;;;;;;;OAQG;IACH,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,kBAAk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