@angular/cli 21.0.2 → 21.1.0-next.1

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 (102) hide show
  1. package/lib/code-examples.db +0 -0
  2. package/package.json +18 -18
  3. package/src/commands/mcp/cli.d.ts +2 -2
  4. package/src/commands/mcp/cli.js.map +1 -1
  5. package/src/commands/mcp/dev-server.d.ts +71 -0
  6. package/src/commands/mcp/dev-server.js +96 -0
  7. package/src/commands/mcp/dev-server.js.map +1 -0
  8. package/src/commands/mcp/host.d.ts +47 -5
  9. package/src/commands/mcp/host.js +52 -13
  10. package/src/commands/mcp/host.js.map +1 -1
  11. package/src/commands/mcp/mcp-server.d.ts +35 -4
  12. package/src/commands/mcp/mcp-server.js +16 -8
  13. package/src/commands/mcp/mcp-server.js.map +1 -1
  14. package/src/commands/mcp/resources/ai-tutor.md +199 -3
  15. package/src/commands/mcp/resources/instructions.d.ts +1 -1
  16. package/src/commands/mcp/resources/instructions.js +2 -5
  17. package/src/commands/mcp/resources/instructions.js.map +1 -1
  18. package/src/commands/mcp/tools/ai-tutor.js +2 -5
  19. package/src/commands/mcp/tools/ai-tutor.js.map +1 -1
  20. package/src/commands/mcp/tools/best-practices.js +6 -9
  21. package/src/commands/mcp/tools/best-practices.js.map +1 -1
  22. package/src/commands/mcp/tools/build.d.ts +37 -0
  23. package/src/commands/mcp/tools/build.js +97 -0
  24. package/src/commands/mcp/tools/build.js.map +1 -0
  25. package/src/commands/mcp/tools/devserver/start-devserver.d.ts +31 -0
  26. package/src/commands/mcp/tools/devserver/start-devserver.js +82 -0
  27. package/src/commands/mcp/tools/devserver/start-devserver.js.map +1 -0
  28. package/src/commands/mcp/tools/devserver/stop-devserver.d.ts +39 -0
  29. package/src/commands/mcp/tools/devserver/stop-devserver.js +66 -0
  30. package/src/commands/mcp/tools/devserver/stop-devserver.js.map +1 -0
  31. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.d.ts +41 -0
  32. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.js +100 -0
  33. package/src/commands/mcp/tools/devserver/wait-for-devserver-build.js.map +1 -0
  34. package/src/commands/mcp/tools/doc-search.js.map +1 -1
  35. package/src/commands/mcp/tools/examples/database-discovery.d.ts +34 -0
  36. package/src/commands/mcp/tools/examples/database-discovery.js +87 -0
  37. package/src/commands/mcp/tools/examples/database-discovery.js.map +1 -0
  38. package/src/commands/mcp/tools/examples/database.d.ts +35 -0
  39. package/src/commands/mcp/tools/examples/database.js +125 -0
  40. package/src/commands/mcp/tools/examples/database.js.map +1 -0
  41. package/src/commands/mcp/tools/examples/index.d.ts +26 -0
  42. package/src/commands/mcp/tools/examples/index.js +149 -0
  43. package/src/commands/mcp/tools/examples/index.js.map +1 -0
  44. package/src/commands/mcp/tools/examples/query-escaper.d.ts +20 -0
  45. package/src/commands/mcp/tools/examples/query-escaper.js +68 -0
  46. package/src/commands/mcp/tools/examples/query-escaper.js.map +1 -0
  47. package/src/commands/mcp/tools/examples/runtime-database.d.ts +10 -0
  48. package/src/commands/mcp/tools/examples/runtime-database.js +192 -0
  49. package/src/commands/mcp/tools/examples/runtime-database.js.map +1 -0
  50. package/src/commands/mcp/tools/{examples.d.ts → examples/schemas.d.ts} +5 -16
  51. package/src/commands/mcp/tools/examples/schemas.js +101 -0
  52. package/src/commands/mcp/tools/examples/schemas.js.map +1 -0
  53. package/src/commands/mcp/tools/examples/utils.d.ts +14 -0
  54. package/src/commands/mcp/tools/examples/utils.js +31 -0
  55. package/src/commands/mcp/tools/examples/utils.js.map +1 -0
  56. package/src/commands/mcp/tools/modernize.d.ts +13 -7
  57. package/src/commands/mcp/tools/modernize.js +13 -45
  58. package/src/commands/mcp/tools/modernize.js.map +1 -1
  59. package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.d.ts → analyze-for-unsupported-zone-uses.d.ts} +1 -1
  60. package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.js → analyze-for-unsupported-zone-uses.js} +2 -2
  61. package/src/commands/mcp/tools/onpush-zoneless-migration/{analyze_for_unsupported_zone_uses.js.map → analyze-for-unsupported-zone-uses.js.map} +1 -1
  62. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.d.ts → migrate-single-file.d.ts} +3 -3
  63. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.js → migrate-single-file.js} +5 -5
  64. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_single_file.js.map → migrate-single-file.js.map} +1 -1
  65. package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_test_file.js → migrate-test-file.js} +6 -52
  66. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate-test-file.js.map +1 -0
  67. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.d.ts +1 -1
  68. package/src/commands/mcp/tools/onpush-zoneless-migration/prompts.js +2 -2
  69. package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.d.ts → send-debug-message.d.ts} +2 -2
  70. package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.js → send-debug-message.js} +1 -1
  71. package/src/commands/mcp/tools/onpush-zoneless-migration/{send_debug_message.js.map → send-debug-message.js.map} +1 -1
  72. package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.d.ts → ts-utils.d.ts} +3 -4
  73. package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js → ts-utils.js} +3 -3
  74. package/src/commands/mcp/tools/onpush-zoneless-migration/{ts_utils.js.map → ts-utils.js.map} +1 -1
  75. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.d.ts +2 -2
  76. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js +67 -71
  77. package/src/commands/mcp/tools/onpush-zoneless-migration/zoneless-migration.js.map +1 -1
  78. package/src/commands/mcp/tools/projects.d.ts +1 -1
  79. package/src/commands/mcp/tools/projects.js +33 -33
  80. package/src/commands/mcp/tools/projects.js.map +1 -1
  81. package/src/commands/mcp/tools/tool-registry.d.ts +4 -0
  82. package/src/commands/mcp/tools/tool-registry.js.map +1 -1
  83. package/src/commands/mcp/utils.d.ts +33 -0
  84. package/src/commands/mcp/utils.js +55 -0
  85. package/src/commands/mcp/utils.js.map +1 -0
  86. package/src/package-managers/host.d.ts +6 -0
  87. package/src/package-managers/host.js +1 -0
  88. package/src/package-managers/host.js.map +1 -1
  89. package/src/package-managers/package-manager-descriptor.d.ts +6 -6
  90. package/src/package-managers/package-manager-descriptor.js +5 -5
  91. package/src/package-managers/package-manager-descriptor.js.map +1 -1
  92. package/src/package-managers/package-manager.d.ts +21 -3
  93. package/src/package-managers/package-manager.js +74 -5
  94. package/src/package-managers/package-manager.js.map +1 -1
  95. package/src/utilities/version.js +1 -1
  96. package/src/commands/mcp/tools/examples.js +0 -657
  97. package/src/commands/mcp/tools/examples.js.map +0 -1
  98. package/src/commands/mcp/tools/onpush-zoneless-migration/migrate_test_file.js.map +0 -1
  99. package/src/package-managers/testing/mock-host.d.ts +0 -26
  100. package/src/package-managers/testing/mock-host.js +0 -53
  101. package/src/package-managers/testing/mock-host.js.map +0 -1
  102. /package/src/commands/mcp/tools/onpush-zoneless-migration/{migrate_test_file.d.ts → migrate-test-file.d.ts} +0 -0
@@ -6,14 +6,16 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { z } from 'zod';
9
- export declare const FIND_EXAMPLE_TOOL: import("./tool-registry").McpToolDeclaration<{
9
+ export declare const findExampleInputSchema: z.ZodObject<{
10
10
  workspacePath: z.ZodOptional<z.ZodString>;
11
11
  query: z.ZodString;
12
12
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
13
  required_packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
14
  related_concepts: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
15
  includeExperimental: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
16
- }, {
16
+ }, z.core.$strip>;
17
+ export type FindExampleInput = z.infer<typeof findExampleInputSchema>;
18
+ export declare const findExampleOutputSchema: z.ZodObject<{
17
19
  examples: z.ZodArray<z.ZodObject<{
18
20
  title: z.ZodString;
19
21
  summary: z.ZodString;
@@ -24,17 +26,4 @@ export declare const FIND_EXAMPLE_TOOL: import("./tool-registry").McpToolDeclara
24
26
  content: z.ZodString;
25
27
  snippet: z.ZodOptional<z.ZodString>;
26
28
  }, z.core.$strip>>;
27
- }>;
28
- /**
29
- * Escapes a search query for FTS5 by tokenizing and quoting terms.
30
- *
31
- * This function processes a raw search string and prepares it for an FTS5 full-text search.
32
- * It correctly handles quoted phrases, logical operators (AND, OR, NOT), parentheses,
33
- * and prefix searches (ending with an asterisk), ensuring that individual search
34
- * terms are properly quoted to be treated as literals by the search engine.
35
- * This is primarily intended to avoid unintentional usage of FTS5 query syntax by consumers.
36
- *
37
- * @param query The raw search query string.
38
- * @returns A sanitized query string suitable for FTS5.
39
- */
40
- export declare function escapeSearchQuery(query: string): string;
29
+ }, z.core.$strip>;
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.findExampleOutputSchema = exports.findExampleInputSchema = void 0;
11
+ const zod_1 = require("zod");
12
+ exports.findExampleInputSchema = zod_1.z.object({
13
+ workspacePath: zod_1.z
14
+ .string()
15
+ .optional()
16
+ .describe('The absolute path to the `angular.json` file for the workspace. This is used to find the ' +
17
+ 'version-specific code examples that correspond to the installed version of the ' +
18
+ 'Angular framework. You **MUST** get this path from the `list_projects` tool. ' +
19
+ 'If omitted, the tool will search the generic code examples bundled with the CLI.'),
20
+ query: zod_1.z
21
+ .string()
22
+ .describe("The primary, conceptual search query. This should capture the user's main goal or question " +
23
+ "(e.g., 'lazy loading a route' or 'how to use signal inputs'). The query will be processed " +
24
+ 'by a powerful full-text search engine.\n\n' +
25
+ 'Key Syntax Features (see https://www.sqlite.org/fts5.html for full documentation):\n' +
26
+ ' - AND (default): Space-separated terms are combined with AND.\n' +
27
+ ' - Example: \'standalone component\' (finds results with both "standalone" and "component")\n' +
28
+ ' - OR: Use the OR operator to find results with either term.\n' +
29
+ " - Example: 'validation OR validator'\n" +
30
+ ' - NOT: Use the NOT operator to exclude terms.\n' +
31
+ " - Example: 'forms NOT reactive'\n" +
32
+ ' - Grouping: Use parentheses () to group expressions.\n' +
33
+ " - Example: '(validation OR validator) AND forms'\n" +
34
+ ' - Phrase Search: Use double quotes "" for exact phrases.\n' +
35
+ ' - Example: \'"template-driven forms"\'\n' +
36
+ ' - Prefix Search: Use an asterisk * for prefix matching.\n' +
37
+ ' - Example: \'rout*\' (matches "route", "router", "routing")'),
38
+ keywords: zod_1.z
39
+ .array(zod_1.z.string())
40
+ .optional()
41
+ .describe('A list of specific, exact keywords to narrow the search. Use this for precise terms like '),
42
+ required_packages: zod_1.z
43
+ .array(zod_1.z.string())
44
+ .optional()
45
+ .describe("A list of NPM packages that an example must use. Use this when the user's request is " +
46
+ 'specific to a feature within a certain package (e.g., if the user asks about `ngModel`, ' +
47
+ 'you should filter by `@angular/forms`).'),
48
+ related_concepts: zod_1.z
49
+ .array(zod_1.z.string())
50
+ .optional()
51
+ .describe('A list of high-level concepts to filter by. Use this to find examples related to broader ' +
52
+ 'architectural ideas or patterns (e.g., `signals`, `dependency injection`, `routing`).'),
53
+ includeExperimental: zod_1.z
54
+ .boolean()
55
+ .optional()
56
+ .default(false)
57
+ .describe('By default, this tool returns only production-safe examples. Set this to `true` **only if** ' +
58
+ 'the user explicitly asks for a bleeding-edge feature or if a stable solution to their ' +
59
+ 'problem cannot be found. If you set this to `true`, you **MUST** preface your answer by ' +
60
+ 'warning the user that the example uses experimental APIs that are not suitable for production.'),
61
+ });
62
+ exports.findExampleOutputSchema = zod_1.z.object({
63
+ examples: zod_1.z.array(zod_1.z.object({
64
+ title: zod_1.z
65
+ .string()
66
+ .describe('The title of the example. Use this as a heading when presenting the example to the user.'),
67
+ summary: zod_1.z
68
+ .string()
69
+ .describe("A one-sentence summary of the example's purpose. Use this to help the user decide " +
70
+ 'if the example is relevant to them.'),
71
+ keywords: zod_1.z
72
+ .array(zod_1.z.string())
73
+ .optional()
74
+ .describe('A list of keywords for the example. You can use these to explain why this example ' +
75
+ "was a good match for the user's query."),
76
+ required_packages: zod_1.z
77
+ .array(zod_1.z.string())
78
+ .optional()
79
+ .describe('A list of NPM packages required for the example to work. Before presenting the code, ' +
80
+ 'you should inform the user if any of these packages need to be installed.'),
81
+ related_concepts: zod_1.z
82
+ .array(zod_1.z.string())
83
+ .optional()
84
+ .describe('A list of related concepts. You can suggest these to the user as topics for ' +
85
+ 'follow-up questions.'),
86
+ related_tools: zod_1.z
87
+ .array(zod_1.z.string())
88
+ .optional()
89
+ .describe('A list of related MCP tools. You can suggest these as potential next steps for the user.'),
90
+ content: zod_1.z
91
+ .string()
92
+ .describe('A complete, self-contained Angular code example in Markdown format. This should be ' +
93
+ 'presented to the user inside a markdown code block.'),
94
+ snippet: zod_1.z
95
+ .string()
96
+ .optional()
97
+ .describe('A contextual snippet from the content showing the matched search term. This field is ' +
98
+ 'critical for efficiently evaluating a result`s relevance. It enables two primary '),
99
+ })),
100
+ });
101
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["schemas.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,6BAAwB;AAEX,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,aAAa,EAAE,OAAC;SACb,MAAM,EAAE;SACR,QAAQ,EAAE;SACV,QAAQ,CACP,2FAA2F;QACzF,iFAAiF;QACjF,+EAA+E;QAC/E,kFAAkF,CACrF;IACH,KAAK,EAAE,OAAC;SACL,MAAM,EAAE;SACR,QAAQ,CACP,6FAA6F;QAC3F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C,CAC3C;QACH,iBAAiB,EAAE,OAAC;aACjB,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,uFAAuF;YACrF,2EAA2E,CAC9E;QACH,gBAAgB,EAAE,OAAC;aAChB,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,8EAA8E;YAC5E,sBAAsB,CACzB;QACH,aAAa,EAAE,OAAC;aACb,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC;aACjB,QAAQ,EAAE;aACV,QAAQ,CACP,0FAA0F,CAC3F;QACH,OAAO,EAAE,OAAC;aACP,MAAM,EAAE;aACR,QAAQ,CACP,qFAAqF;YACnF,qDAAqD,CACxD;QACH,OAAO,EAAE,OAAC;aACP,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,uFAAuF;YACrF,mFAAmF,CACtF;KACJ,CAAC,CACH;CACF,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ /**
9
+ * Suppresses the experimental warning emitted by Node.js for the `node:sqlite` module.
10
+ *
11
+ * This is a workaround to prevent the console from being cluttered with warnings
12
+ * about the experimental status of the SQLite module, which is used by this tool.
13
+ */
14
+ export declare function suppressSqliteWarning(): void;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.suppressSqliteWarning = suppressSqliteWarning;
11
+ /**
12
+ * Suppresses the experimental warning emitted by Node.js for the `node:sqlite` module.
13
+ *
14
+ * This is a workaround to prevent the console from being cluttered with warnings
15
+ * about the experimental status of the SQLite module, which is used by this tool.
16
+ */
17
+ function suppressSqliteWarning() {
18
+ const originalProcessEmit = process.emit;
19
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
+ process.emit = function (event, error) {
21
+ if (event === 'warning' &&
22
+ error instanceof Error &&
23
+ error.name === 'ExperimentalWarning' &&
24
+ error.message.includes('SQLite')) {
25
+ return false;
26
+ }
27
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, prefer-rest-params
28
+ return originalProcessEmit.apply(process, arguments);
29
+ };
30
+ }
31
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAQH,sDAgBC;AAtBD;;;;;GAKG;AACH,SAAgB,qBAAqB;IACnC,MAAM,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IACzC,8DAA8D;IAC9D,OAAO,CAAC,IAAI,GAAG,UAAU,KAAa,EAAE,KAAe;QACrD,IACE,KAAK,KAAK,SAAS;YACnB,KAAK,YAAY,KAAK;YACtB,KAAK,CAAC,IAAI,KAAK,qBAAqB;YACpC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAChC,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;QAED,kFAAkF;QAClF,OAAO,mBAAmB,CAAC,KAAK,CAAC,OAAO,EAAE,SAAgB,CAAC,CAAC;IAC9D,CAAC,CAAC;AACJ,CAAC"}
@@ -6,8 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import { z } from 'zod';
9
- import { Host } from '../host';
10
- import { McpToolDeclaration } from './tool-registry';
9
+ import { type Host } from '../host';
10
+ import { type McpToolDeclaration } from './tool-registry';
11
11
  declare const modernizeInputSchema: z.ZodObject<{
12
12
  directories: z.ZodOptional<z.ZodArray<z.ZodString>>;
13
13
  transformations: z.ZodOptional<z.ZodArray<z.ZodEnum<{
@@ -16,8 +16,7 @@ declare const modernizeInputSchema: z.ZodObject<{
16
16
  }, z.core.$strip>;
17
17
  declare const modernizeOutputSchema: z.ZodObject<{
18
18
  instructions: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
- stdout: z.ZodOptional<z.ZodString>;
20
- stderr: z.ZodOptional<z.ZodString>;
19
+ logs: z.ZodOptional<z.ZodArray<z.ZodString>>;
21
20
  }, z.core.$strip>;
22
21
  export type ModernizeInput = z.infer<typeof modernizeInputSchema>;
23
22
  export type ModernizeOutput = z.infer<typeof modernizeOutputSchema>;
@@ -27,9 +26,16 @@ export declare function runModernization(input: ModernizeInput, host: Host): Pro
27
26
  text: string;
28
27
  }[];
29
28
  structuredContent: {
30
- instructions?: string[] | undefined;
31
- stdout?: string | undefined;
32
- stderr?: string | undefined;
29
+ instructions: string[];
30
+ };
31
+ } | {
32
+ content: {
33
+ type: "text";
34
+ text: string;
35
+ }[];
36
+ structuredContent: {
37
+ instructions: string[] | undefined;
38
+ logs: string[];
33
39
  };
34
40
  }>;
35
41
  export declare const MODERNIZE_TOOL: McpToolDeclaration<typeof modernizeInputSchema.shape, typeof modernizeOutputSchema.shape>;
@@ -12,6 +12,7 @@ exports.runModernization = runModernization;
12
12
  const path_1 = require("path");
13
13
  const zod_1 = require("zod");
14
14
  const host_1 = require("../host");
15
+ const utils_1 = require("../utils");
15
16
  const tool_registry_1 = require("./tool-registry");
16
17
  const TRANSFORMATIONS = [
17
18
  {
@@ -72,33 +73,13 @@ const modernizeOutputSchema = zod_1.z.object({
72
73
  .array(zod_1.z.string())
73
74
  .optional()
74
75
  .describe('Migration summary, as well as any instructions that need to be performed to complete the migrations.'),
75
- stdout: zod_1.z.string().optional().describe('The stdout from the executed commands.'),
76
- stderr: zod_1.z.string().optional().describe('The stderr from the executed commands.'),
76
+ logs: zod_1.z.array(zod_1.z.string()).optional().describe('All logs from all executed commands.'),
77
77
  });
78
- function createToolOutput(structuredContent) {
79
- return {
80
- content: [{ type: 'text', text: JSON.stringify(structuredContent, null, 2) }],
81
- structuredContent,
82
- };
83
- }
84
- function findAngularJsonDir(startDir, host) {
85
- let currentDir = startDir;
86
- while (true) {
87
- if (host.existsSync((0, path_1.join)(currentDir, 'angular.json'))) {
88
- return currentDir;
89
- }
90
- const parentDir = (0, path_1.dirname)(currentDir);
91
- if (parentDir === currentDir) {
92
- return null;
93
- }
94
- currentDir = parentDir;
95
- }
96
- }
97
78
  async function runModernization(input, host) {
98
79
  const transformationNames = input.transformations ?? [];
99
80
  const directories = input.directories ?? [];
100
81
  if (transformationNames.length === 0) {
101
- return createToolOutput({
82
+ return (0, utils_1.createStructuredContentOutput)({
102
83
  instructions: [
103
84
  'See https://angular.dev/best-practices for Angular best practices. ' +
104
85
  'You can call this tool if you have specific transformation you want to run.',
@@ -106,7 +87,7 @@ async function runModernization(input, host) {
106
87
  });
107
88
  }
108
89
  if (directories.length === 0) {
109
- return createToolOutput({
90
+ return (0, utils_1.createStructuredContentOutput)({
110
91
  instructions: [
111
92
  'Provide this tool with a list of directory paths in your workspace ' +
112
93
  'to run the modernization on.',
@@ -115,15 +96,14 @@ async function runModernization(input, host) {
115
96
  }
116
97
  const firstDir = directories[0];
117
98
  const executionDir = (await host.stat(firstDir)).isDirectory() ? firstDir : (0, path_1.dirname)(firstDir);
118
- const angularProjectRoot = findAngularJsonDir(executionDir, host);
99
+ const angularProjectRoot = (0, utils_1.findAngularJsonDir)(executionDir, host);
119
100
  if (!angularProjectRoot) {
120
- return createToolOutput({
101
+ return (0, utils_1.createStructuredContentOutput)({
121
102
  instructions: ['Could not find an angular.json file in the current or parent directories.'],
122
103
  });
123
104
  }
124
105
  const instructions = [];
125
- const stdoutMessages = [];
126
- const stderrMessages = [];
106
+ let logs = [];
127
107
  const transformationsToRun = TRANSFORMATIONS.filter((t) => transformationNames.includes(t.name));
128
108
  for (const transformation of transformationsToRun) {
129
109
  if (transformation.instructions) {
@@ -141,36 +121,24 @@ async function runModernization(input, host) {
141
121
  const command = 'ng';
142
122
  const args = ['generate', `@angular/core:${transformation.name}`, '--path', relativePath];
143
123
  try {
144
- const { stdout, stderr } = await host.runCommand(command, args, {
124
+ logs = (await host.runCommand(command, args, {
145
125
  cwd: angularProjectRoot,
146
- });
147
- if (stdout) {
148
- stdoutMessages.push(stdout);
149
- }
150
- if (stderr) {
151
- stderrMessages.push(stderr);
152
- }
126
+ })).logs;
153
127
  instructions.push(`Migration ${transformation.name} on directory ${relativePath} completed successfully.`);
154
128
  }
155
129
  catch (e) {
156
130
  if (e instanceof host_1.CommandError) {
157
- if (e.stdout) {
158
- stdoutMessages.push(e.stdout);
159
- }
160
- if (e.stderr) {
161
- stderrMessages.push(e.stderr);
162
- }
131
+ logs = e.logs;
163
132
  }
164
- stderrMessages.push(e.message);
133
+ logs.push(e.message);
165
134
  instructions.push(`Migration ${transformation.name} on directory ${relativePath} failed.`);
166
135
  }
167
136
  }
168
137
  }
169
138
  }
170
- return createToolOutput({
139
+ return (0, utils_1.createStructuredContentOutput)({
171
140
  instructions: instructions.length > 0 ? instructions : undefined,
172
- stdout: stdoutMessages?.join('\n\n') || undefined,
173
- stderr: stderrMessages?.join('\n\n') || undefined,
141
+ logs,
174
142
  });
175
143
  }
176
144
  exports.MODERNIZE_TOOL = (0, tool_registry_1.declareTool)({
@@ -1 +1 @@
1
- {"version":3,"file":"modernize.js","sourceRoot":"","sources":["modernize.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA8GH,4CAsFC;AAlMD,+BAA+C;AAC/C,6BAAwB;AACxB,kCAAiE;AACjE,mDAAkE;AASlE,MAAM,eAAe,GAA0B;IAC7C;QACE,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,qHAAqH;QACvH,gBAAgB,EAAE,uDAAuD;KAC1E;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EACT,oHAAoH;QACtH,gBAAgB,EAAE,4DAA4D;KAC/E;IACD;QACE,IAAI,EAAE,Q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C,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;QAChE,IAAI;KACL,CAAC,CAAC;AACL,CAAC;AAEY,QAAA,cAAc,GAGvB,IAAA,2BAAW,EAAC;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;EAuBb,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;qBACrD;IACnB,WAAW,EAAE,oBAAoB,CAAC,KAAK;IACvC,YAAY,EAAE,qBAAqB,CAAC,KAAK;IACzC,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,gBAAgB,CAAC,KAAK,EAAE,yBAAkB,CAAC;CACtE,CAAC,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import type { ImportSpecifier, Node, SourceFile } from 'typescript';
9
- import { MigrationResponse } from './types';
9
+ import type { MigrationResponse } from './types';
10
10
  export declare function analyzeForUnsupportedZoneUses(sourceFile: SourceFile): Promise<MigrationResponse | null>;
11
11
  /**
12
12
  * Finds usages of `NgZone` that are not supported in zoneless applications.
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.analyzeForUnsupportedZoneUses = analyzeForUnsupportedZoneUses;
11
11
  exports.findUnsupportedZoneUsages = findUnsupportedZoneUsages;
12
12
  const prompts_1 = require("./prompts");
13
- const ts_utils_1 = require("./ts_utils");
13
+ const ts_utils_1 = require("./ts-utils");
14
14
  async function analyzeForUnsupportedZoneUses(sourceFile) {
15
15
  const ngZoneImport = await (0, ts_utils_1.getImportSpecifier)(sourceFile, '@angular/core', 'NgZone');
16
16
  if (!ngZoneImport) {
@@ -59,4 +59,4 @@ async function findUnsupportedZoneUsages(sourceFile, ngZoneImport) {
59
59
  });
60
60
  return unsupportedUsages;
61
61
  }
62
- //# sourceMappingURL=analyze_for_unsupported_zone_uses.js.map
62
+ //# sourceMappingURL=analyze-for-unsupported-zone-uses.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"analyze_for_unsupported_zone_uses.js","sourceRoot":"","sources":["analyze_for_unsupported_zone_uses.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAOH,sEAoBC;AAQD,8DAkCC;AAlED,uCAA+D;AAC/D,yCAAgE;AAGzD,KAAK,UAAU,6BAA6B,CACjD,UAAsB;IAEtB,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAkB,EAAC,UAAU,EAAE,eAAe,EAAE,QAAQ,CAAC,CAAC;IACrF,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,iBAAiB,GAAG,MAAM,yBAAyB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;IAEpF,IAAI,iBAAiB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,SAAS,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAU,EAAE,EAAE;QACrD,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,6BAA6B,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEtF,OAAO,QAAQ,IAAI,GAAG,CAAC,eAAe,SAAS,GAAG,CAAC,KAAK,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEH,OAAO,IAAA,4CAAkC,EAAC,SAAS,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;AAC5E,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,yBAAyB,CAC7C,UAAsB,EACtB,YAA6B;IAE7B,M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KAAK,CAAC,IAAI;QAC7C,IAAI,EAAE,CAAC,0BAA0B,CAAC,IAAI,CAAC,EAAE,CAAC;YACxC,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACpC,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;YAE3D,0BAA0B;YAC1B,IAAI,cAAc,KAAK,eAAe,IAAI,aAAa,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBAC1E,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;YAED,gDAAgD;YAChD,IAAI,eAAe,CAAC,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC;gBACtC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;QACH,CAAC;QACD,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -5,8 +5,8 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
9
- import { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
8
+ import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
9
+ import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
10
10
  import type { SourceFile } from 'typescript';
11
- import { MigrationResponse } from './types';
11
+ import type { MigrationResponse } from './types';
12
12
  export declare function migrateSingleFile(sourceFile: SourceFile, extras: RequestHandlerExtra<ServerRequest, ServerNotification>): Promise<MigrationResponse | null>;
@@ -8,11 +8,11 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.migrateSingleFile = migrateSingleFile;
11
- const analyze_for_unsupported_zone_uses_1 = require("./analyze_for_unsupported_zone_uses");
12
- const migrate_test_file_1 = require("./migrate_test_file");
11
+ const analyze_for_unsupported_zone_uses_1 = require("./analyze-for-unsupported-zone-uses");
12
+ const migrate_test_file_1 = require("./migrate-test-file");
13
13
  const prompts_1 = require("./prompts");
14
- const send_debug_message_1 = require("./send_debug_message");
15
- const ts_utils_1 = require("./ts_utils");
14
+ const send_debug_message_1 = require("./send-debug-message");
15
+ const ts_utils_1 = require("./ts-utils");
16
16
  async function migrateSingleFile(sourceFile, extras) {
17
17
  const testBedSpecifier = await (0, ts_utils_1.getImportSpecifier)(sourceFile, '@angular/core/testing', 'TestBed');
18
18
  const isTestFile = sourceFile.fileName.endsWith('.spec.ts') || !!testBedSpecifier;
@@ -70,4 +70,4 @@ async function migrateSingleFile(sourceFile, extras) {
70
70
  // Component decorator found, but no change detection strategy.
71
71
  return (0, prompts_1.generateZonelessMigrationInstructionsForComponent)(sourceFile.fileName);
72
72
  }
73
- //# sourceMappingURL=migrate_single_file.js.map
73
+ //# sourceMappingURL=migrate-single-file.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrate_single_file.js","sourceRoot":"","sources":["migrate_single_file.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAYH,8CA8EC;AArFD,2FAAoF;AACpF,2DAAsD;AACtD,uCAA8E;AAC9E,6DAAwD;AACxD,yCAAgE;AAGzD,KAAK,UAAU,iBAAiB,CACrC,UAAsB,EACtB,MAA8D;IAE9D,MAAM,gBAAgB,GAAG,MAAM,IAAA,6BAAkB,EAAC,UAAU,EAAE,uBAAuB,EAAE,SAAS,CAAC,CAAC;IAClG,MAAM,UAAU,GAAG,UAAU,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC;IAClF,IAAI,UAAU,EAAE,CAAC;QACf,OAAO,IAAA,mCAAe,EAAC,UAAU,CAAC,CAAC;IACrC,CAAC;IAED,MAAM,0BAA0B,GAAG,MAA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ChF,CAAC"}
@@ -6,47 +6,14 @@
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.dev/license
8
8
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
9
  Object.defineProperty(exports, "__esModule", { value: true });
43
10
  exports.migrateTestFile = migrateTestFile;
44
11
  exports.searchForGlobalZoneless = searchForGlobalZoneless;
45
- const fs = __importStar(require("node:fs"));
12
+ const node_fs_1 = require("node:fs");
46
13
  const promises_1 = require("node:fs/promises");
47
- const node_path_1 = require("node:path");
14
+ const utils_1 = require("../../utils");
48
15
  const prompts_1 = require("./prompts");
49
- const ts_utils_1 = require("./ts_utils");
16
+ const ts_utils_1 = require("./ts-utils");
50
17
  async function migrateTestFile(sourceFile) {
51
18
  const ts = await (0, ts_utils_1.loadTypescript)();
52
19
  // Check if tests use zoneless either by default through `initTestEnvironment` or by explicitly calling `provideZonelessChangeDetection`.
@@ -69,7 +36,7 @@ async function migrateTestFile(sourceFile) {
69
36
  return (0, prompts_1.createFixResponseForZoneTests)(sourceFile);
70
37
  }
71
38
  async function searchForGlobalZoneless(startPath) {
72
- const angularJsonDir = findAngularJsonDir(startPath);
39
+ const angularJsonDir = (0, utils_1.findAngularJsonDir)(startPath);
73
40
  if (!angularJsonDir) {
74
41
  // Cannot determine project root, fallback to original behavior or assume false.
75
42
  // For now, let's assume no global setup if angular.json is not found.
@@ -78,7 +45,7 @@ async function searchForGlobalZoneless(startPath) {
78
45
  try {
79
46
  const files = (0, promises_1.glob)(`${angularJsonDir}/**/*.ts`);
80
47
  for await (const file of files) {
81
- const content = fs.readFileSync(file, 'utf-8');
48
+ const content = (0, node_fs_1.readFileSync)(file, 'utf-8');
82
49
  if (content.includes('initTestEnvironment') &&
83
50
  content.includes('provideZonelessChangeDetection')) {
84
51
  return true;
@@ -90,17 +57,4 @@ async function searchForGlobalZoneless(startPath) {
90
57
  }
91
58
  return false;
92
59
  }
93
- function findAngularJsonDir(startDir) {
94
- let currentDir = startDir;
95
- while (true) {
96
- if (fs.existsSync((0, node_path_1.join)(currentDir, 'angular.json'))) {
97
- return currentDir;
98
- }
99
- const parentDir = (0, node_path_1.dirname)(currentDir);
100
- if (parentDir === currentDir) {
101
- return null;
102
- }
103
- currentDir = parentDir;
104
- }
105
- }
106
- //# sourceMappingURL=migrate_test_file.js.map
60
+ //# sourceMappingURL=migrate-test-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-test-file.js","sourceRoot":"","sources":["migrate-test-file.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAWH,0CAyBC;AAED,0DAwBC;AA5DD,qCAAmD;AACnD,+CAAwC;AAGxC,uCAAiD;AACjD,uCAAoG;AACpG,yCAA4C;AAGrC,KAAK,UAAU,eAAe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C;gBACvC,OAAO,CAAC,QAAQ,CAAC,gCAAgC,CAAC,EAClD,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -6,7 +6,7 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import type { SourceFile } from 'typescript';
9
- import { MigrationResponse } from './types';
9
+ import type { MigrationResponse } from './types';
10
10
  export declare function createProvideZonelessForTestsSetupPrompt(testFilePath: string): MigrationResponse;
11
11
  export declare function createUnsupportedZoneUsagesMessage(usages: string[], filePath: string): MigrationResponse;
12
12
  export declare function generateZonelessMigrationInstructionsForComponent(filePath: string): MigrationResponse;
@@ -13,7 +13,7 @@ exports.generateZonelessMigrationInstructionsForComponent = generateZonelessMigr
13
13
  exports.createTestDebuggingGuideForNonActionableInput = createTestDebuggingGuideForNonActionableInput;
14
14
  exports.createFixResponseForZoneTests = createFixResponseForZoneTests;
15
15
  exports.createResponse = createResponse;
16
- const ts_utils_1 = require("./ts_utils");
16
+ const ts_utils_1 = require("./ts-utils");
17
17
  /* eslint-disable max-len */
18
18
  function createProvideZonelessForTestsSetupPrompt(testFilePath) {
19
19
  const text = `You are an expert Angular developer assisting with a migration to zoneless. Your task is to update the test file at \`${testFilePath}\` to enable zoneless change detection and identify tests that are not yet compatible.
@@ -34,7 +34,7 @@ function createProvideZonelessForTestsSetupPrompt(testFilePath) {
34
34
  \`\`\`diff
35
35
  - import {{ SomeImport }} from '@angular/core';
36
36
  + import {{ SomeImport, provideZonelessChangeDetection }} from '@angular/core';
37
-
37
+
38
38
  describe('MyComponent', () => {
39
39
  + beforeEach(() => {
40
40
  + TestBed.configureTestingModule({providers: [provideZonelessChangeDetection()]});
@@ -5,6 +5,6 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
- import { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
9
- import { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
8
+ import type { RequestHandlerExtra } from '@modelcontextprotocol/sdk/shared/protocol';
9
+ import type { ServerNotification, ServerRequest } from '@modelcontextprotocol/sdk/types';
10
10
  export declare function sendDebugMessage(message: string, { sendNotification }: RequestHandlerExtra<ServerRequest, ServerNotification>): void;
@@ -17,4 +17,4 @@ function sendDebugMessage(message, { sendNotification }) {
17
17
  },
18
18
  });
19
19
  }
20
- //# sourceMappingURL=send_debug_message.js.map
20
+ //# sourceMappingURL=send-debug-message.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"send_debug_message.js","sourceRoot":"","sources":["send_debug_message.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKH,4CAWC;AAXD,SAAgB,gBAAgB,CAC9B,OAAe,EACf,EAAE,gBAAgB,EAA0D;IAE5E,KAAK,gBAAgB,CAAC;QACpB,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;SACd;KACF,CAAC,CAAC;AACL,CAAC"}
1
+ {"version":3,"file":"send-debug-message.js","sourceRoot":"","sources":["send-debug-message.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAKH,4CAWC;AAXD,SAAgB,gBAAgB,CAC9B,OAAe,EACf,EAAE,gBAAgB,EAA0D;IAE5E,KAAK,gBAAgB,CAAC;QACpB,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE;YACN,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,OAAO;SACd;KACF,CAAC,CAAC;AACL,CAAC"}