@camunda8/cli 4.7.0-alpha.3 → 4.7.0-alpha.4

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 (33) hide show
  1. package/README.md +1 -0
  2. package/dist/commands/deploy.d.ts.map +1 -1
  3. package/dist/commands/deploy.js +46 -7
  4. package/dist/commands/deploy.js.map +1 -1
  5. package/dist/commands/helpers/deploy-helpers.d.ts +83 -2
  6. package/dist/commands/helpers/deploy-helpers.d.ts.map +1 -1
  7. package/dist/commands/helpers/deploy-helpers.js +204 -65
  8. package/dist/commands/helpers/deploy-helpers.js.map +1 -1
  9. package/dist/commands/watch.d.ts.map +1 -1
  10. package/dist/commands/watch.js +301 -16
  11. package/dist/commands/watch.js.map +1 -1
  12. package/dist/default-plugins/cluster/c8ctl-plugin.js +1 -1
  13. package/dist/utils/command-local/setup-detectors.d.ts +51 -0
  14. package/dist/utils/command-local/setup-detectors.d.ts.map +1 -0
  15. package/dist/utils/command-local/setup-detectors.js +115 -0
  16. package/dist/utils/command-local/setup-detectors.js.map +1 -0
  17. package/dist/utils/index.d.ts +2 -0
  18. package/dist/utils/index.d.ts.map +1 -1
  19. package/dist/utils/index.js +2 -0
  20. package/dist/utils/index.js.map +1 -1
  21. package/dist/utils/shared/camunda-json.d.ts +8 -0
  22. package/dist/utils/shared/camunda-json.d.ts.map +1 -1
  23. package/dist/utils/shared/camunda-json.js +3 -0
  24. package/dist/utils/shared/camunda-json.js.map +1 -1
  25. package/dist/utils/shared/deploy-resource-selection.d.ts +173 -0
  26. package/dist/utils/shared/deploy-resource-selection.d.ts.map +1 -0
  27. package/dist/utils/shared/deploy-resource-selection.js +476 -0
  28. package/dist/utils/shared/deploy-resource-selection.js.map +1 -0
  29. package/dist/utils/shared/ignore.d.ts +26 -0
  30. package/dist/utils/shared/ignore.d.ts.map +1 -1
  31. package/dist/utils/shared/ignore.js +6 -2
  32. package/dist/utils/shared/ignore.js.map +1 -1
  33. package/package.json +1 -1
@@ -3,10 +3,12 @@ export * from "./command-local/mcp-proxy-helpers.ts";
3
3
  export * from "./command-local/open-helpers.ts";
4
4
  export * from "./command-local/process-instance-helpers.ts";
5
5
  export * from "./command-local/search-helpers.ts";
6
+ export * from "./command-local/setup-detectors.ts";
6
7
  export * from "./command-local/setup-prerequisites.ts";
7
8
  export * from "./command-local/watch-constants.ts";
8
9
  export * from "./shared/camunda-json.ts";
9
10
  export * from "./shared/date-filter.ts";
11
+ export * from "./shared/deploy-resource-selection.ts";
10
12
  export * from "./shared/ignore.ts";
11
13
  export * from "./shared/npm-exec.ts";
12
14
  export * from "./shared/resource-extensions.ts";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAMA,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAMA,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -9,10 +9,12 @@ export * from "./command-local/mcp-proxy-helpers.js";
9
9
  export * from "./command-local/open-helpers.js";
10
10
  export * from "./command-local/process-instance-helpers.js";
11
11
  export * from "./command-local/search-helpers.js";
12
+ export * from "./command-local/setup-detectors.js";
12
13
  export * from "./command-local/setup-prerequisites.js";
13
14
  export * from "./command-local/watch-constants.js";
14
15
  export * from "./shared/camunda-json.js";
15
16
  export * from "./shared/date-filter.js";
17
+ export * from "./shared/deploy-resource-selection.js";
16
18
  export * from "./shared/ignore.js";
17
19
  export * from "./shared/npm-exec.js";
18
20
  export * from "./shared/resource-extensions.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,wCAAwC;AACxC,+DAA+D;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,EAAE;AACF,+EAA+E;AAC/E,iFAAiF;AACjF,wCAAwC;AACxC,+DAA+D;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,mCAAmC,CAAC;AAClD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iCAAiC,CAAC;AAChD,cAAc,wBAAwB,CAAC;AACvC,cAAc,6BAA6B,CAAC"}
@@ -32,6 +32,14 @@ export interface CamundaProject {
32
32
  /** ID of the linked project in Camunda Hub. */
33
33
  projectId?: string;
34
34
  };
35
+ /**
36
+ * Raw value of the optional `deployResources` field, kept verbatim
37
+ * when the key is present (even when it is `null` or wrong-typed) so
38
+ * the integration that consumes it can validate strictly and report
39
+ * a precise error. Absent key → property absent. Validate with
40
+ * `parseDeployResources` from `deploy-resource-selection.ts`.
41
+ */
42
+ deployResources?: unknown;
35
43
  }
36
44
  /**
37
45
  * Decode descriptor bytes, tolerating the BOMs that Windows tooling
@@ -1 +1 @@
1
- {"version":3,"file":"camunda-json.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,uCAAuC;IACvC,GAAG,CAAC,EAAE;QACL,+CAA+C;QAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;CACF;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAA6B,GACnC,cAAc,CAgChB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CASzE"}
1
+ {"version":3,"file":"camunda-json.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAMH,qDAAqD;AACrD,eAAO,MAAM,oBAAoB,iBAAiB,CAAC;AAEnD,iEAAiE;AACjE,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC9B,uCAAuC;IACvC,GAAG,CAAC,EAAE;QACL,+CAA+C;QAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAKxD;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC/B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,MAA6B,GACnC,cAAc,CAoChB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CASzE"}
@@ -67,6 +67,9 @@ export function parseCamundaJson(content, source = CAMUNDA_PROJECT_FILE) {
67
67
  project.hub =
68
68
  typeof hub.projectId === "string" ? { projectId: hub.projectId } : {};
69
69
  }
70
+ if (Object.hasOwn(parsed, "deployResources")) {
71
+ project.deployResources = parsed.deployResources;
72
+ }
70
73
  return project;
71
74
  }
72
75
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"camunda-json.js","sourceRoot":"","sources":["../../../src/utils/shared/camunda-json.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG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AAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACxE,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,EAAE,CAAC;QAC9C,OAAO,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IAClD,CAAC;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IACrD,IAAI,MAAc,CAAC;IACnB,IAAI,CAAC;QACJ,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * `deployResources` — descriptor-based selection of a project's resources.
3
+ *
4
+ * The optional top-level `deployResources` array in `camunda.json` selects
5
+ * which project files are deployed (and watched with `watch --project`).
6
+ *
7
+ * Patterns use the same engine and syntax as `.c8ignore` (`parsePattern`
8
+ * from `ignore.ts`, evaluated with `node:path#matchesGlob` relative to the
9
+ * project root with `/` separators), with two deliberate differences:
10
+ *
11
+ * - **Inverted polarity.** Selection starts empty; a positive pattern
12
+ * selects, a `!` pattern deselects, and the last matching pattern wins
13
+ * per file.
14
+ * - **Direct descendant selection.** There is no gitignore "excluded
15
+ * parent" rule: a later positive pattern restores a file below an
16
+ * earlier excluded directory. The directory walk therefore never prunes
17
+ * a directory because a negative pattern matched it — it only skips a
18
+ * directory when no positive pattern can match anything below it.
19
+ *
20
+ * Defaults: `node_modules/`, `target/`, `.git/` and the project-root
21
+ * `camunda.json` are evaluated as implicit leading `!` patterns, so any
22
+ * later positive pattern that matches a file inside them overrides them.
23
+ *
24
+ * Hidden files: the engine's wildcards (`*`, `?`, `**`, `[...]`) never
25
+ * match a path segment that starts with `.`. A pattern selects a
26
+ * dot-prefixed file — or anything inside a dot-prefixed directory — only
27
+ * when it names that segment explicitly (e.g. `resources/.prompt.md`,
28
+ * `.config/**`). The walker still descends into hidden directories so
29
+ * such explicit patterns can reach them.
30
+ */
31
+ import { type CamundaProject } from "./camunda-json.ts";
32
+ /** Name of the descriptor field. */
33
+ export declare const DEPLOY_RESOURCES_FIELD = "deployResources";
34
+ /**
35
+ * Default exclusions, applied as implicit leading negations before the
36
+ * user's patterns. The root descriptor is anchored; the directories match
37
+ * at any depth (same as the `.c8ignore` defaults).
38
+ */
39
+ export declare const DEPLOY_RESOURCES_DEFAULT_EXCLUSIONS: readonly string[];
40
+ /** Tool-agnostic error codes, shared with the parity fixtures. */
41
+ export type DeployResourcesErrorCode = "invalid-config" | "empty-selection" | "read-error";
42
+ /**
43
+ * Raised for an invalid `deployResources` configuration, an empty final
44
+ * selection, or a selected path that cannot be read (`read-error`). `code` matches the `error` value used by the shared parity
45
+ * fixtures.
46
+ */
47
+ export declare class DeployResourcesError extends Error {
48
+ readonly code: DeployResourcesErrorCode;
49
+ constructor(code: DeployResourcesErrorCode, message: string);
50
+ }
51
+ /**
52
+ * Validate the raw `deployResources` value read from `camunda.json`.
53
+ *
54
+ * @param value - The raw field value (`CamundaProject.deployResources`).
55
+ * @param source - Descriptor path used in error messages.
56
+ * @returns The validated pattern list (possibly empty).
57
+ * @throws {DeployResourcesError} `invalid-config` when the value is not an
58
+ * array of valid pattern strings.
59
+ */
60
+ export declare function parseDeployResources(value: unknown, source?: string): string[];
61
+ /**
62
+ * Strictly read the `camunda.json` descriptor of a directory that is being
63
+ * resolved for deployment or watching.
64
+ *
65
+ * Unlike `readCamundaProject` (lenient marker detection), a descriptor
66
+ * that exists but cannot be read — a directory named `camunda.json`, no
67
+ * permission, an I/O error — is an `invalid-config` error. Degrading to
68
+ * "no descriptor" would silently fall back to the default scan and
69
+ * bypass a `deployResources` allowlist.
70
+ *
71
+ * @returns The parsed descriptor, or `null` only when no `camunda.json`
72
+ * exists.
73
+ * @throws {DeployResourcesError} `invalid-config` when the file exists but
74
+ * cannot be read.
75
+ * @throws {Error} When `camunda.json` is not valid JSON.
76
+ */
77
+ export declare function readProjectDescriptor(dirPath: string): CamundaProject | null;
78
+ /** Outcome of reading a project's `deployResources` configuration. */
79
+ export type DeployResourcesState = {
80
+ kind: "no-descriptor";
81
+ } | {
82
+ kind: "no-field";
83
+ } | {
84
+ kind: "patterns";
85
+ patterns: string[];
86
+ };
87
+ /**
88
+ * Read a project's `deployResources` state, distinguishing a missing
89
+ * descriptor from a descriptor without the field.
90
+ *
91
+ * @throws {DeployResourcesError} `invalid-config` when the descriptor
92
+ * cannot be read or the field is invalid.
93
+ * @throws {Error} When `camunda.json` is not valid JSON.
94
+ */
95
+ export declare function readDeployResourcesState(projectRoot: string): DeployResourcesState;
96
+ /**
97
+ * The `deployResources` state of an already-read descriptor (`null` when
98
+ * there is none), so a caller can decide from a single read.
99
+ *
100
+ * @throws {DeployResourcesError} `invalid-config` when the field is invalid.
101
+ */
102
+ export declare function deployResourcesStateOf(project: CamundaProject | null, projectRoot: string): DeployResourcesState;
103
+ /**
104
+ * Read the validated `deployResources` patterns of the project rooted at
105
+ * `projectRoot`.
106
+ *
107
+ * @returns The patterns, or `null` when there is no descriptor or the
108
+ * descriptor has no `deployResources` key (default scan applies).
109
+ * @throws {Error} When `camunda.json` is not valid JSON.
110
+ * @throws {DeployResourcesError} `invalid-config` when the descriptor
111
+ * cannot be read or the field is invalid.
112
+ */
113
+ export declare function readDeployResources(projectRoot: string): string[] | null;
114
+ /** A compiled `deployResources` pattern list. */
115
+ export interface ResourceSelector {
116
+ /** The user's patterns, in order. */
117
+ readonly patterns: readonly string[];
118
+ /** Whether the project-relative file path is selected. */
119
+ selects(relPath: string): boolean;
120
+ /**
121
+ * Whether any file below the project-relative directory could be
122
+ * selected. Conservative: `true` whenever a positive pattern might
123
+ * match below `relDir`. Used only to skip walking directories that can
124
+ * never contribute (e.g. `.git/` under `["**\/*"]`).
125
+ */
126
+ couldSelectUnder(relDir: string): boolean;
127
+ /**
128
+ * Whether the folder is excluded: a `!` pattern matches it (e.g.
129
+ * `!vendor/`, or a default exclusion) and no later positive pattern
130
+ * matches it or can reach below it. Used to skip a folder that can't be
131
+ * read only when nothing inside it can be selected.
132
+ */
133
+ excludesFolder(relDir: string): boolean;
134
+ }
135
+ /**
136
+ * Compile validated `deployResources` patterns into a selector.
137
+ * Call {@link parseDeployResources} first to validate raw input.
138
+ */
139
+ export declare function compileDeployResources(patterns: readonly string[]): ResourceSelector;
140
+ /**
141
+ * Walk `projectRoot` and return the project-relative (`/`-separated)
142
+ * paths of every file the selector selects, sorted.
143
+ *
144
+ * - Symlinks are followed (same as the default deploy discovery). A
145
+ * directory reachable under several project-relative paths (a symlink
146
+ * alias and its real path) is walked under each of them, because
147
+ * patterns are evaluated against the project-relative path. Cycles are
148
+ * cut by skipping a directory whose real path is already on the
149
+ * current descent (an active ancestor). Files that resolve to the same
150
+ * real path are kept once (first path in sorted order wins).
151
+ * - Hidden files and directories are not skipped by the walker — the
152
+ * pattern engine decides (see module docs).
153
+ * - Nested `camunda.json` folders are ordinary folders here: nested
154
+ * projects are unsupported and are not excluded from the selection.
155
+ */
156
+ export declare function selectProjectFiles(projectRoot: string, selector: ResourceSelector): string[];
157
+ /**
158
+ * The `read-error` raised when a path a `deployResources` pattern can
159
+ * select cannot be read. Names the path and, for a dangling symlink,
160
+ * says so.
161
+ */
162
+ export declare function unreadablePath(path: string, error: unknown,
163
+ /** Project-relative path, used to suggest an exclusion pattern. */
164
+ rel?: string): DeployResourcesError;
165
+ /**
166
+ * Resolve the deployed resource set of a project from its validated
167
+ * `deployResources` patterns.
168
+ *
169
+ * @throws {DeployResourcesError} `empty-selection` when nothing is
170
+ * selected (an unmatched pattern alone is silently ignored).
171
+ */
172
+ export declare function resolveDeployResources(projectRoot: string, patterns: readonly string[]): string[];
173
+ //# sourceMappingURL=deploy-resource-selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deploy-resource-selection.d.ts","sourceRoot":"","sources":["../../../src/utils/shared/deploy-resource-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAWH,OAAO,EAEN,KAAK,cAAc,EAGnB,MAAM,mBAAmB,CAAC;AAO3B,oCAAoC;AACpC,eAAO,MAAM,sBAAsB,oBAAoB,CAAC;AAExD;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,EAAE,SAAS,MAAM,EAKhE,CAAC;AAEF,kEAAkE;AAClE,MAAM,MAAM,wBAAwB,GACjC,gBAAgB,GAChB,iBAAiB,GACjB,YAAY,CAAC;AAEhB;;;;GAIG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;gBAC5B,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM;CAK3D;AAkCD;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CACnC,KAAK,EAAE,OAAO,EACd,MAAM,SAAiB,GACrB,MAAM,EAAE,CA0BV;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CA4B5E;AAED,sEAAsE;AACtE,MAAM,MAAM,oBAAoB,GAC7B;IAAE,IAAI,EAAE,eAAe,CAAA;CAAE,GACzB;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GACpB;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAE5C;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACvC,WAAW,EAAE,MAAM,GACjB,oBAAoB,CAKtB;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACrC,OAAO,EAAE,cAAc,GAAG,IAAI,EAC9B,WAA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