@coderabbitai/config 1.0.0 → 1.1.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.
package/README.md CHANGED
@@ -45,19 +45,126 @@ export default defineConfig(ctx => ({
45
45
  `"review"` for reviews initiated through an SCM provider or another review
46
46
  client.
47
47
 
48
+ For pull requests and merge requests, `ctx.pr.authorGroups` exposes the
49
+ author's provider groups without putting provider-specific objects in your
50
+ config:
51
+
52
+ ```ts
53
+ import { defineConfig } from "@coderabbitai/config"
54
+
55
+ export default defineConfig(ctx => {
56
+ const groups =
57
+ ctx.pr?.authorGroups.status === "resolved" ? ctx.pr.authorGroups.groups : []
58
+ const isUsaPlatform = groups.some(
59
+ group => group.fullPath === "acme/platform-usa",
60
+ )
61
+
62
+ return {
63
+ language: isUsaPlatform ? "en-US" : "ko-KR",
64
+ }
65
+ })
66
+ ```
67
+
68
+ Each group has a provider-stable `id`, a short `slug`, and a provider-qualified
69
+ `fullPath`. `status` is:
70
+
71
+ - `"resolved"`: the provider returned the complete visible membership list;
72
+ `groups` may be empty.
73
+ - `"unavailable"`: permissions, timeout, provider failure, or a safety bound
74
+ prevented a complete lookup. `groups` is empty and must not be treated as
75
+ proof that the author belongs to no groups.
76
+ - `"unsupported"`: the current provider or invocation has no author-group
77
+ resolver. Local CLI reviews currently use this status.
78
+ - `"stale"`: reserved for a future cached membership result.
79
+
80
+ GitHub and GitHub Enterprise resolve organization teams. GitLab.com and
81
+ self-managed GitLab resolve direct group memberships visible to CodeRabbit;
82
+ GitLab's membership API does not include inherited or shared group membership.
83
+
84
+ Repository topics and GitHub custom properties are available under `ctx.repo`:
85
+
86
+ ```ts
87
+ import { defineConfig } from "@coderabbitai/config"
88
+
89
+ export default defineConfig(ctx => {
90
+ const topics =
91
+ ctx.repo.topics.status === "resolved" ? ctx.repo.topics.names : []
92
+ const properties =
93
+ ctx.repo.customProperties.status === "resolved"
94
+ ? ctx.repo.customProperties.values
95
+ : {}
96
+
97
+ const isCriticalService =
98
+ topics.includes("critical") && properties.repo_type === "service"
99
+
100
+ return {
101
+ reviews: {
102
+ profile: isCriticalService ? "assertive" : "chill",
103
+ },
104
+ }
105
+ })
106
+ ```
107
+
108
+ `topics.names` is a sorted list. `customProperties.values` is keyed by the
109
+ property name; each value is a string, a string array, or `null`. Both objects
110
+ use the same `resolved`, `unavailable`, `unsupported`, and reserved `stale`
111
+ statuses as author groups. A resolved collection may be empty. An unavailable
112
+ collection is unknown and must not be treated as authoritatively empty.
113
+
114
+ GitHub supplies topics and custom properties. Other providers and local CLI
115
+ reviews currently report `unsupported`; GitHub failures and unsupported GitHub
116
+ Enterprise versions report `unavailable`. These lookups use the installation's
117
+ existing metadata read permission and run only when a TypeScript config is
118
+ evaluated.
119
+
120
+ `ctx.pr.changedFiles` exposes the complete set of repository-relative paths in
121
+ the pull request or merge request diff. This makes it possible to select review
122
+ policy based on the areas a change touches:
123
+
124
+ ```ts
125
+ import { defineConfig } from "@coderabbitai/config"
126
+
127
+ export default defineConfig(ctx => {
128
+ const paths =
129
+ ctx.pr?.changedFiles.status === "resolved" ? ctx.pr.changedFiles.paths : []
130
+ const touchesInfrastructure = paths.some(
131
+ path => path.startsWith("terraform/") || path.endsWith(".tf"),
132
+ )
133
+
134
+ return {
135
+ reviews: {
136
+ profile: touchesInfrastructure ? "assertive" : "chill",
137
+ },
138
+ }
139
+ })
140
+ ```
141
+
142
+ The status is `"resolved"` only when CodeRabbit has the complete path list.
143
+ Provider errors, timeouts, revision changes, or safety limits produce
144
+ `"unavailable"` with an empty list; platforms without a complete inventory
145
+ produce `"unsupported"`. Never interpret either status as proof that no files
146
+ changed. Renames include both the previous and current path so policies can
147
+ detect files moving into or out of a protected area.
148
+
48
149
  ### Composing configs
49
150
 
50
151
  `mergeConfig` deep-merges fragments (objects merge, arrays concatenate, later
51
152
  scalars win), and `includeRemote` pulls a shared fragment from your
52
- organization's `coderabbit` repository:
153
+ organization's `coderabbit` repository by default:
53
154
 
54
155
  ```ts
55
156
  import { defineConfig, mergeConfig, includeRemote } from "@coderabbitai/config"
56
157
 
57
158
  const orgBase = includeRemote({ path: "base.ts" })
58
159
 
160
+ const platformBase = includeRemote({
161
+ repo: "acme/platform-config",
162
+ path: "reviews/base.ts",
163
+ ref: "v1",
164
+ })
165
+
59
166
  export default defineConfig(
60
- mergeConfig(orgBase, { reviews: { profile: "assertive" } }),
167
+ mergeConfig(orgBase, platformBase, { reviews: { profile: "assertive" } }),
61
168
  )
62
169
  ```
63
170
 
@@ -74,12 +181,28 @@ shape.
74
181
 
75
182
  - `defineConfig(config | (ctx) => config)` — typed identity for your config.
76
183
  - `mergeConfig(...fragments)` — deep-merge fragments (arrays concatenate).
77
- - `includeRemote({ path, ref? })` — include a shared file from your org's
78
- `coderabbit` repository.
184
+ - `includeRemote({ repo?, path, ref? })` — include a shared file. `repo` uses the
185
+ provider-native repository format and defaults to your org's `coderabbit`
186
+ repository.
79
187
  - Types: `CodeRabbitConfig`, `CodeRabbitContext`,
188
+ `CodeRabbitAuthorGroup`, `CodeRabbitAuthorGroupsContext`,
189
+ `CodeRabbitAuthorGroupsStatus`, `CodeRabbitContextResolutionStatus`,
190
+ `CodeRabbitChangedFilesContext`, `CodeRabbitChangedFilesStatus`,
191
+ `CodeRabbitRepositoryContext`, `CodeRabbitRepositoryTopicsContext`,
192
+ `CodeRabbitRepositoryCustomPropertiesContext`,
193
+ `CodeRabbitRepositoryCustomPropertyValue`, `CodeRabbitPullRequestContext`,
80
194
  `CodeRabbitInvocationContext`, `CodeRabbitInvocationSource`,
81
195
  `ResolvedCodeRabbitContext`, `RemoteInclude`.
82
196
 
197
+ ## Building the SDK
198
+
199
+ From the repository root, run `pnpm exec turbo run build --filter=@coderabbitai/config`.
200
+ The build explicitly uses stable TypeScript 7 through the package-local
201
+ `typescript-native` alias. TypeScript 6 remains installed as `typescript` for
202
+ `dts-bundle-generator`'s JavaScript compiler API; a bare `tsc` could select that
203
+ older compiler instead. Keep the compiler and declaration-generation dependencies
204
+ inside this package, not in the root workspace.
205
+
83
206
  ## License
84
207
 
85
208
  [Apache-2.0](./LICENSE)
@@ -34,6 +34,127 @@ export interface CodeRabbitInvocationContext {
34
34
  */
35
35
  readonly source: CodeRabbitInvocationSource;
36
36
  }
37
+ /** A source-control group the pull-request author belongs to. */
38
+ export interface CodeRabbitAuthorGroup {
39
+ /** Provider-stable group or team identifier. */
40
+ readonly id: string;
41
+ /** Short team/group path segment, e.g. `"platform-usa"`. */
42
+ readonly slug: string;
43
+ /** Provider-qualified path, e.g. `"acme/platform-usa"`. */
44
+ readonly fullPath: string;
45
+ }
46
+ /** Availability of provider metadata exposed to a config factory. */
47
+ export type CodeRabbitContextResolutionStatus = "resolved" | "stale" | "unavailable" | "unsupported";
48
+ /** Availability of pull-request author group membership. */
49
+ export type CodeRabbitAuthorGroupsStatus = CodeRabbitContextResolutionStatus;
50
+ /** Provider group memberships resolved by CodeRabbit for the PR author. */
51
+ export interface CodeRabbitAuthorGroupsContext {
52
+ readonly status: CodeRabbitAuthorGroupsStatus;
53
+ readonly groups: readonly CodeRabbitAuthorGroup[];
54
+ }
55
+ export type CodeRabbitChangedFilesStatus = "resolved" | "unavailable" | "unsupported";
56
+ /** Complete changed paths for the pull/merge request being configured. */
57
+ export interface CodeRabbitChangedFilesContext {
58
+ readonly status: CodeRabbitChangedFilesStatus;
59
+ /**
60
+ * Repository-relative paths affected by the change. Renames include both the
61
+ * previous and current path so rules cannot miss a file moving into or out of
62
+ * a protected area.
63
+ */
64
+ readonly paths: readonly string[];
65
+ }
66
+ /**
67
+ * Repository topics resolved from the source-control provider.
68
+ *
69
+ * A `resolved` result is authoritative even when `names` is empty.
70
+ * `unavailable` means the value is unknown, `unsupported` means the current
71
+ * provider or invocation cannot resolve it, and `stale` is reserved for a
72
+ * future cached result.
73
+ */
74
+ export interface CodeRabbitRepositoryTopicsContext {
75
+ readonly status: CodeRabbitContextResolutionStatus;
76
+ /** Sorted topic names; meaningful as a complete result only when resolved. */
77
+ readonly names: readonly string[];
78
+ }
79
+ /** A scalar, multi-select, or unset provider-defined custom-property value. */
80
+ export type CodeRabbitRepositoryCustomPropertyValue = string | readonly string[] | null;
81
+ /**
82
+ * Repository custom properties resolved from the source-control provider.
83
+ *
84
+ * A `resolved` result is authoritative even when `values` is empty.
85
+ * `unavailable` means the value is unknown, `unsupported` means the current
86
+ * provider or invocation cannot resolve it, and `stale` is reserved for a
87
+ * future cached result.
88
+ */
89
+ export interface CodeRabbitRepositoryCustomPropertiesContext {
90
+ readonly status: CodeRabbitContextResolutionStatus;
91
+ /** Values keyed by provider property name. */
92
+ readonly values: Readonly<Record<string, CodeRabbitRepositoryCustomPropertyValue>>;
93
+ }
94
+ /** Repository context supplied to a programmatic config. */
95
+ export interface CodeRabbitRepositoryContext {
96
+ readonly owner: string;
97
+ readonly name: string;
98
+ /** Fully-qualified name / path-with-namespace, e.g. `"acme/api"`. */
99
+ readonly fullName: string;
100
+ /** Primary language reported by the provider, or `null` if unknown. */
101
+ readonly language: string | null;
102
+ /** `true` for a private repository. */
103
+ readonly isPrivate: boolean;
104
+ /**
105
+ * `true` when the SCM is a customer-hosted instance (GHES, self-hosted
106
+ * GitLab, Bitbucket Data Center, …) rather than the provider's cloud.
107
+ */
108
+ readonly isSelfHosted: boolean;
109
+ readonly defaultBranch: string;
110
+ /**
111
+ * Provider repository topics, resolved when a TypeScript config is evaluated.
112
+ * GitHub supplies this metadata; other providers and local CLI evaluations
113
+ * currently report `unsupported`. GitHub lookup failures report `unavailable`.
114
+ * Optional on the public construction type for source compatibility; inferred
115
+ * config factories receive it at runtime.
116
+ */
117
+ readonly topics?: CodeRabbitRepositoryTopicsContext;
118
+ /**
119
+ * Provider repository custom properties, resolved when a TypeScript config is
120
+ * evaluated. GitHub supplies this metadata; other providers and local CLI
121
+ * evaluations currently report `unsupported`. GitHub lookup failures report
122
+ * `unavailable`. Optional on the public construction type for source
123
+ * compatibility; inferred config factories receive it at runtime.
124
+ */
125
+ readonly customProperties?: CodeRabbitRepositoryCustomPropertiesContext;
126
+ }
127
+ /** Pull/merge request context supplied to a programmatic config. */
128
+ export interface CodeRabbitPullRequestContext {
129
+ readonly number: number;
130
+ readonly title: string;
131
+ /** Branch the PR merges into (base/target). */
132
+ readonly baseBranch: string;
133
+ /** Branch the PR is from (head/source). */
134
+ readonly headBranch: string;
135
+ /** Author's username/handle. */
136
+ readonly author: string;
137
+ /**
138
+ * Author's association with the repo, e.g. `"OWNER"`, `"MEMBER"`,
139
+ * `"COLLABORATOR"`, `"CONTRIBUTOR"`, `"FIRST_TIME_CONTRIBUTOR"`, `"NONE"`.
140
+ * `null` when the provider does not report it.
141
+ */
142
+ readonly authorAssociation: string | null;
143
+ /**
144
+ * Author's GitHub organization teams or direct GitLab groups. Optional on
145
+ * the public construction type for source compatibility; inferred config
146
+ * factories receive it at runtime.
147
+ */
148
+ readonly authorGroups?: CodeRabbitAuthorGroupsContext;
149
+ /**
150
+ * Complete changed paths for this PR/MR. Optional on the public construction
151
+ * type for source compatibility; inferred config factories receive it at
152
+ * runtime.
153
+ */
154
+ readonly changedFiles?: CodeRabbitChangedFilesContext;
155
+ readonly labels: readonly string[];
156
+ readonly isDraft: boolean;
157
+ }
37
158
  /**
38
159
  * Runtime context passed to a config factory. It describes the repository,
39
160
  * organization, and (for PR/MR events) the pull request being reviewed, so a
@@ -56,22 +177,7 @@ export interface CodeRabbitContext {
56
177
  * `"azure-devops"`, `"bitbucket"`.
57
178
  */
58
179
  readonly platform: string;
59
- readonly repo: {
60
- readonly owner: string;
61
- readonly name: string;
62
- /** Fully-qualified name / path-with-namespace, e.g. `"acme/api"`. */
63
- readonly fullName: string;
64
- /** Primary language reported by the provider, or `null` if unknown. */
65
- readonly language: string | null;
66
- /** `true` for a private repository. */
67
- readonly isPrivate: boolean;
68
- /**
69
- * `true` when the SCM is a customer-hosted instance (GHES, self-hosted
70
- * GitLab, Bitbucket Data Center, …) rather than the provider's cloud.
71
- */
72
- readonly isSelfHosted: boolean;
73
- readonly defaultBranch: string;
74
- };
180
+ readonly repo: CodeRabbitRepositoryContext;
75
181
  /** The owning organization, or `null` if the provider has no org concept. */
76
182
  readonly org: {
77
183
  readonly name: string;
@@ -80,36 +186,33 @@ export interface CodeRabbitContext {
80
186
  * Pull/merge request context. Present for PR/MR events; `null` for other
81
187
  * events (or when PR details could not be resolved).
82
188
  */
83
- readonly pr: {
84
- readonly number: number;
85
- readonly title: string;
86
- /** Branch the PR merges into (base/target). */
87
- readonly baseBranch: string;
88
- /** Branch the PR is from (head/source). */
89
- readonly headBranch: string;
90
- /** Author's username/handle. */
91
- readonly author: string;
92
- /**
93
- * Author's association with the repo, e.g. `"OWNER"`, `"MEMBER"`,
94
- * `"COLLABORATOR"`, `"CONTRIBUTOR"`, `"FIRST_TIME_CONTRIBUTOR"`, `"NONE"`.
95
- * `null` when the provider does not report it.
96
- */
97
- readonly authorAssociation: string | null;
98
- readonly labels: readonly string[];
99
- readonly isDraft: boolean;
100
- } | null;
189
+ readonly pr: CodeRabbitPullRequestContext | null;
101
190
  }
102
- /** Complete context CodeRabbit passes to an inferred config factory. */
103
- export interface ResolvedCodeRabbitContext extends CodeRabbitContext {
191
+ /**
192
+ * Context with invocation metadata resolved. Enriched pull-request fields remain
193
+ * optional here so existing consumers can keep constructing this public type.
194
+ */
195
+ export interface ResolvedCodeRabbitContext extends Omit<CodeRabbitContext, "invocation"> {
104
196
  readonly invocation: CodeRabbitInvocationContext;
105
197
  }
198
+ /** Complete runtime context inferred config factories receive. */
199
+ interface CodeRabbitConfigFactoryContext extends Omit<ResolvedCodeRabbitContext, "pr" | "repo"> {
200
+ readonly repo: CodeRabbitRepositoryContext & {
201
+ readonly topics: CodeRabbitRepositoryTopicsContext;
202
+ readonly customProperties: CodeRabbitRepositoryCustomPropertiesContext;
203
+ };
204
+ readonly pr: (CodeRabbitPullRequestContext & {
205
+ readonly authorGroups: CodeRabbitAuthorGroupsContext;
206
+ readonly changedFiles: CodeRabbitChangedFilesContext;
207
+ }) | null;
208
+ }
106
209
  /**
107
210
  * A config factory: returns the config object (or a promise of it), optionally
108
211
  * using the {@link CodeRabbitContext} to compute values. This is the form you
109
212
  * use when your config needs to adapt to the invocation source, repo, org, or
110
213
  * pull request.
111
214
  */
112
- export type CodeRabbitConfigFactory = (ctx: ResolvedCodeRabbitContext) => CodeRabbitConfig | Promise<CodeRabbitConfig>;
215
+ export type CodeRabbitConfigFactory = (ctx: CodeRabbitConfigFactoryContext) => CodeRabbitConfig | Promise<CodeRabbitConfig>;
113
216
  /**
114
217
  * Define a CodeRabbit configuration with full type-checking and autocomplete.
115
218
  *
@@ -180,18 +283,25 @@ export declare function defineConfig(config: CodeRabbitConfigFactory): CodeRabbi
180
283
  */
181
284
  export declare function mergeConfig(...configs: CodeRabbitConfig[]): CodeRabbitConfig;
182
285
  /**
183
- * Location of a shared config file, for {@link includeRemote}. The file is read
184
- * from your organization's `coderabbit` configuration repository — the target
185
- * repository is not (currently) configurable.
286
+ * Location of a shared config file, for {@link includeRemote}. When `repo` is
287
+ * omitted, the file is read from your organization's `coderabbit`
288
+ * configuration repository.
186
289
  */
187
290
  export interface RemoteInclude {
188
291
  /**
189
- * File path within your org's `coderabbit` repository, e.g. `"base.ts"` or
292
+ * Repository containing the shared config. Uses the same provider-native
293
+ * format as `remote_config`: `owner/repository` on GitHub and the full
294
+ * `group[/subgroup]/project` namespace on GitLab. Omit this field to use your
295
+ * organization's `coderabbit` repository.
296
+ */
297
+ readonly repo?: string;
298
+ /**
299
+ * File path within the selected repository, e.g. `"base.ts"` or
190
300
  * `"configs/base.yaml"`.
191
301
  */
192
302
  readonly path: string;
193
303
  /**
194
- * Branch, tag, or commit SHA of the `coderabbit` repo. Optional — omit to
304
+ * Branch, tag, or commit SHA of the selected repository. Optional — omit to
195
305
  * track its default branch (so edits propagate automatically); pin it for
196
306
  * reproducibility.
197
307
  */
@@ -208,10 +318,11 @@ export interface RemoteInclude {
208
318
  * export default defineConfig(mergeConfig(orgBase, { reviews: { profile: "assertive" } }))
209
319
  * ```
210
320
  *
211
- * Shared files are always read from the `{owner}/coderabbit` repository (the
212
- * same repo CodeRabbit uses for org-wide central config); the source repository
213
- * is not configurable for now. The file is fetched (with your installation's
214
- * read access) and evaluated in the same sandbox as your config.
321
+ * When `repo` is omitted, shared files are read from the `{owner}/coderabbit`
322
+ * repository (the same repo CodeRabbit uses for org-wide central config). A
323
+ * non-central repository is fetched only after CodeRabbit verifies the access
324
+ * required for the configuration source. The file is evaluated in the same
325
+ * sandbox as your config.
215
326
  *
216
327
  * **This is a bundle-time directive**: the argument must be an inline object
217
328
  * literal with string values (it is resolved before your config runs, so it
@@ -219,4 +330,5 @@ export interface RemoteInclude {
219
330
  * bundling; the runtime body below only executes if resolution was bypassed.
220
331
  */
221
332
  export declare function includeRemote(spec: RemoteInclude): CodeRabbitConfig;
333
+ export {};
222
334
  //# sourceMappingURL=define-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-config.d.ts","sourceRoot":"","sources":["../src/define-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAA;AAE7E,wEAAwE;AACxE,MAAM,MAAM,0BAA0B,GAAG,KAAK,GAAG,QAAQ,CAAA;AAEzD,+EAA+E;AAC/E,MAAM,WAAW,2BAA2B;IAC3C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAA;CAC3C;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,iBAAiB;IACjC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,2BAA2B,CAAA;IACjD;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EA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AE,gBAAgB,EAAE,GAAG,gBAAgB,CAK5E;AAED;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,gBAAgB,CAKnE"}
@@ -64,10 +64,11 @@ export function mergeConfig(...configs) {
64
64
  * export default defineConfig(mergeConfig(orgBase, { reviews: { profile: "assertive" } }))
65
65
  * ```
66
66
  *
67
- * Shared files are always read from the `{owner}/coderabbit` repository (the
68
- * same repo CodeRabbit uses for org-wide central config); the source repository
69
- * is not configurable for now. The file is fetched (with your installation's
70
- * read access) and evaluated in the same sandbox as your config.
67
+ * When `repo` is omitted, shared files are read from the `{owner}/coderabbit`
68
+ * repository (the same repo CodeRabbit uses for org-wide central config). A
69
+ * non-central repository is fetched only after CodeRabbit verifies the access
70
+ * required for the configuration source. The file is evaluated in the same
71
+ * sandbox as your config.
71
72
  *
72
73
  * **This is a bundle-time directive**: the argument must be an inline object
73
74
  * literal with string values (it is resolved before your config runs, so it
@@ -1 +1 @@
1
- {"version":3,"file":"define-config.js","sourceRoot":"","sources":["../src/define-config.ts"],"names":[],"mappings":"AAgKA,MAAM,UAAU,YAAY,CAC3B,MAAkD;IAElD,OAAO,MAAM,CAAA;AACd,CAAC;AAED,SAAS,aAAa,CAAC,KAAc;IACpC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC5E,CAAC;AAcD,SAAS,eAAe,CAAC,CAAU,EAAE,CAAU;IAC9C,IAAI,CAAC,KAAK,SAAS;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