@chengyu08/ipa-cli 0.2.4 → 0.2.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 (33) hide show
  1. package/README.md +36 -0
  2. package/assets/setup/manifest.json +9 -0
  3. package/assets/setup/payload.tar.gz +0 -0
  4. package/assets/setup/templates/claude/.claude.json +12 -0
  5. package/assets/setup/templates/claude/CLAUDE.md +12 -0
  6. package/assets/setup/templates/claude/RTK.md +29 -0
  7. package/assets/setup/templates/claude/settings.json +32 -0
  8. package/assets/setup/templates/codex/AGENTS.md +12 -0
  9. package/assets/setup/templates/codex/RTK.md +32 -0
  10. package/assets/setup/templates/codex/config.toml +38 -0
  11. package/dist/src/cli.js +5 -1
  12. package/dist/src/cli.js.map +1 -1
  13. package/dist/src/commands/naming.d.ts +2 -0
  14. package/dist/src/commands/naming.js +51 -0
  15. package/dist/src/commands/naming.js.map +1 -0
  16. package/dist/src/commands/setup.d.ts +2 -0
  17. package/dist/src/commands/setup.js +32 -0
  18. package/dist/src/commands/setup.js.map +1 -0
  19. package/dist/src/core/actions/ios-build-template.js +304 -58
  20. package/dist/src/core/actions/ios-build-template.js.map +1 -1
  21. package/dist/src/core/ip.js +2 -2
  22. package/dist/src/core/naming.d.ts +18 -0
  23. package/dist/src/core/naming.js +107 -0
  24. package/dist/src/core/naming.js.map +1 -0
  25. package/dist/src/core/screenshots/render.js +44 -2
  26. package/dist/src/core/screenshots/render.js.map +1 -1
  27. package/dist/src/core/setup.d.ts +45 -0
  28. package/dist/src/core/setup.js +551 -0
  29. package/dist/src/core/setup.js.map +1 -0
  30. package/dist/src/models/screenshots.d.ts +15 -0
  31. package/dist/src/models/screenshots.js +3 -0
  32. package/dist/src/models/screenshots.js.map +1 -1
  33. package/package.json +3 -2
package/README.md CHANGED
@@ -596,6 +596,7 @@ cp ./scripts/ipatool.env.example ./scripts/ipatool.env
596
596
  - `scan`:把目标样本与本地基线库做 Top N 检索
597
597
  - `smoke`:执行 `analyze + scan + Top1 compare` 的端到端冒烟检查
598
598
  - `upload`:使用 Apple Transporter 将 IPA 上传到 App Store Connect
599
+ - `setup init`:一键安装 Codex / Claude / CodeGraph / RTK,并合并全局 skills / 插件快照
599
600
  - `actions init-ios-build`:初始化 GitHub Actions iOS 构建模板、签名目录和 Secrets 说明
600
601
  - `convert pdf-to-png`:将单个 PDF 文件转换为 PNG 图片
601
602
  - `convert png-to-pdf`:将单张 PNG 或目录内多张 PNG 合并为 PDF
@@ -820,6 +821,27 @@ ipa-cli upload ./dist/export --dry-run
820
821
 
821
822
  如果你已经提前配置了 `ASC_APPLE_ID` / `ASC_APP_PASSWORD` 或 `ASC_API_KEY` / `ASC_API_ISSUER` / `ASC_PRIVATE_KEY_FILE`,通常不再需要重复传认证参数。
822
823
 
824
+ ### `setup`
825
+
826
+ 为新机器初始化 agent 开发环境:缺失时安装 `codex` / `claude` / `codegraph` / `rtk`,并把包内置的全局 skills、Claude 插件快照合并到用户目录。已存在的工具会跳过安装,已有配置文件不会被覆盖。
827
+
828
+ ```bash
829
+ ipa-cli setup init [--dry-run] [--format text|json]
830
+ ```
831
+
832
+ 示例:
833
+
834
+ ```bash
835
+ ipa-cli setup init
836
+ ipa-cli setup init --dry-run
837
+ ```
838
+
839
+ 如果需要在当前维护机器上刷新内置的全局 skills / 插件快照,可执行:
840
+
841
+ ```bash
842
+ npm run setup:bundle
843
+ ```
844
+
823
845
  ### `actions`
824
846
 
825
847
  初始化 GitHub Actions iOS 构建模板,并生成签名材料目录、Secrets 模板和指导文档。
@@ -852,6 +874,20 @@ ipa-cli actions init-ios-build ./YourProject --bundle-id com.example.app --schem
852
874
  - `ci/github-actions/ios-build/secrets.example.env`
853
875
  - `ci/github-actions/ios-build/signing/`
854
876
 
877
+ 生成的 workflow 默认使用 `macos-latest`。Flutter 项目会安装 stable channel 的最新版本,并默认用 `flutter build ipa --release --export-options-plist=...` 打包;手动触发 workflow 时可以填写 `flutter_version` 固定 Flutter 版本,填写 `flutter_build_name` 固定版本名,留空就读取 `pubspec.yaml`。如果某个项目不适配 `flutter build ipa`,把 `flutter_build_mode` 切到 `xcodebuild-archive`,会改走 `flutter build ios --release --no-codesign` + `xcodebuild archive` / `xcodebuild -exportArchive`。需要指定 Xcode 时,可以填写 `xcode_path`,例如 `/Applications/Xcode_26.3.app`。
878
+
879
+ 最低心智操作:
880
+
881
+ ```bash
882
+ ipa-cli actions init-ios-build ./YourProject
883
+ # 把 .p12 放到 ci/github-actions/ios-build/signing/certs/
884
+ # 把 .mobileprovision 放到 ci/github-actions/ios-build/signing/profiles/
885
+ ./ci/github-actions/ios-build/signing/scripts/print-secrets.sh
886
+ ./ci/github-actions/ios-build/signing/scripts/print-secrets.sh --apply
887
+ ```
888
+
889
+ 不带参数运行 `print-secrets.sh` 会自动识别目录里唯一的 `.p12` / `.mobileprovision`,询问一次 `.p12` 导出密码,然后把对应 key/value 写入 `ci/github-actions/ios-build/secrets.example.env`。`--apply` 会先同步这个文件,再用 GitHub CLI 直接写入 4 个 Repository secrets。没有 GitHub CLI 时,可以从 `secrets.example.env` 手动复制。
890
+
855
891
  其中 README 会明确写出:
856
892
 
857
893
  - `.cer`、`.p12`、`.mobileprovision` 分别放哪里
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 1,
3
+ "generatedFrom": "current-machine-global-agent-state",
4
+ "notes": [
5
+ "payload.tar.gz contains bundled skills and Claude plugin snapshots",
6
+ "templates contain portable default configs for fresh Codex and Claude installs",
7
+ "existing configs are intentionally left untouched by setup init"
8
+ ]
9
+ }
Binary file
@@ -0,0 +1,12 @@
1
+ {
2
+ "mcpServers": {
3
+ "codegraph": {
4
+ "type": "stdio",
5
+ "command": "codegraph",
6
+ "args": [
7
+ "serve",
8
+ "--mcp"
9
+ ]
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,12 @@
1
+ @RTK.md
2
+
3
+ <!-- CODEGRAPH_START -->
4
+ ## CodeGraph
5
+
6
+ In repositories indexed by CodeGraph (a `.codegraph/` directory exists at the repo root), reach for it BEFORE grep/find or reading files when you need to understand or locate code:
7
+
8
+ - **MCP tools** (when available): `codegraph_explore` answers most code questions in one call — the relevant symbols' verbatim source plus the call paths between them. `codegraph_node` returns one symbol's source + callers, or reads a whole file with line numbers. If the tools are listed but deferred, load them by name via tool search.
9
+ - **Shell** (always works): `codegraph explore "<symbol names or question>"` and `codegraph node <symbol-or-file>` print the same output.
10
+
11
+ If there is no `.codegraph/` directory, skip CodeGraph entirely — indexing is the user's decision.
12
+ <!-- CODEGRAPH_END -->
@@ -0,0 +1,29 @@
1
+ # RTK - Rust Token Killer
2
+
3
+ **Usage**: Token-optimized CLI proxy (60-90% savings on dev operations)
4
+
5
+ ## Meta Commands (always use rtk directly)
6
+
7
+ ```bash
8
+ rtk gain # Show token savings analytics
9
+ rtk gain --history # Show command usage history with savings
10
+ rtk discover # Analyze Claude Code history for missed opportunities
11
+ rtk proxy <cmd> # Execute raw command without filtering (for debugging)
12
+ ```
13
+
14
+ ## Installation Verification
15
+
16
+ ```bash
17
+ rtk --version # Should show: rtk X.Y.Z
18
+ rtk gain # Should work (not "command not found")
19
+ which rtk # Verify correct binary
20
+ ```
21
+
22
+ ⚠️ **Name collision**: If `rtk gain` fails, you may have reachingforthejack/rtk (Rust Type Kit) installed instead.
23
+
24
+ ## Hook-Based Usage
25
+
26
+ All other commands are automatically rewritten by the Claude Code hook.
27
+ Example: `git status` → `rtk git status` (transparent, 0 tokens overhead)
28
+
29
+ Refer to CLAUDE.md for full command reference.
@@ -0,0 +1,32 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "WebSearch",
5
+ "mcp__codegraph__codegraph_explore",
6
+ "mcp__codegraph__codegraph_search",
7
+ "mcp__codegraph__codegraph_node",
8
+ "mcp__codegraph__codegraph_callers",
9
+ "mcp__codegraph__codegraph_callees",
10
+ "mcp__codegraph__codegraph_impact",
11
+ "mcp__codegraph__codegraph_files",
12
+ "mcp__codegraph__codegraph_status"
13
+ ]
14
+ },
15
+ "enabledPlugins": {
16
+ "swift-lsp@claude-plugins-official": true
17
+ },
18
+ "effortLevel": "high",
19
+ "hooks": {
20
+ "PreToolUse": [
21
+ {
22
+ "matcher": "Bash",
23
+ "hooks": [
24
+ {
25
+ "type": "command",
26
+ "command": "rtk hook claude"
27
+ }
28
+ ]
29
+ }
30
+ ]
31
+ }
32
+ }
@@ -0,0 +1,12 @@
1
+ @RTK.md
2
+
3
+ <!-- CODEGRAPH_START -->
4
+ ## CodeGraph
5
+
6
+ In repositories indexed by CodeGraph (a `.codegraph/` directory exists at the repo root), reach for it BEFORE grep/find or reading files when you need to understand or locate code:
7
+
8
+ - **MCP tools** (when available): `codegraph_explore` answers most code questions in one call — the relevant symbols' verbatim source plus the call paths between them. `codegraph_node` returns one symbol's source + callers, or reads a whole file with line numbers. If the tools are listed but deferred, load them by name via tool search.
9
+ - **Shell** (always works): `codegraph explore "<symbol names or question>"` and `codegraph node <symbol-or-file>` print the same output.
10
+
11
+ If there is no `.codegraph/` directory, skip CodeGraph entirely — indexing is the user's decision.
12
+ <!-- CODEGRAPH_END -->
@@ -0,0 +1,32 @@
1
+ # RTK - Rust Token Killer (Codex CLI)
2
+
3
+ **Usage**: Token-optimized CLI proxy for shell commands.
4
+
5
+ ## Rule
6
+
7
+ Always prefix shell commands with `rtk`.
8
+
9
+ Examples:
10
+
11
+ ```bash
12
+ rtk git status
13
+ rtk cargo test
14
+ rtk npm run build
15
+ rtk pytest -q
16
+ ```
17
+
18
+ ## Meta Commands
19
+
20
+ ```bash
21
+ rtk gain # Token savings analytics
22
+ rtk gain --history # Recent command savings history
23
+ rtk proxy <cmd> # Run raw command without filtering
24
+ ```
25
+
26
+ ## Verification
27
+
28
+ ```bash
29
+ rtk --version
30
+ rtk gain
31
+ which rtk
32
+ ```
@@ -0,0 +1,38 @@
1
+ model_provider = "xai"
2
+ model = "gpt-5.4"
3
+ model_reasoning_effort = "xhigh"
4
+ plan_mode_reasoning_effort = "xhigh"
5
+ model_reasoning_summary = "none"
6
+ model_context_window = 1050000
7
+ model_auto_compact_token_limit = 945000
8
+ stream_idle_timeout_ms = 900000
9
+ approval_policy = "never"
10
+ sandbox_mode = "danger-full-access"
11
+ suppress_unstable_features_warning = true
12
+ personality = "pragmatic"
13
+
14
+ [model_providers.xai]
15
+ name = "OpenAI"
16
+ base_url = "https://api.xairouter.com"
17
+ wire_api = "responses"
18
+ requires_openai_auth = false
19
+ env_key = "XAI_API_KEY"
20
+ supports_websockets = true
21
+
22
+ [features]
23
+ responses_websockets_v2 = true
24
+ remote_connections = true
25
+ js_repl = false
26
+ memories = true
27
+
28
+ [desktop]
29
+ localeOverride = "zh-CN"
30
+
31
+ [memories]
32
+ generate_memories = true
33
+ use_memories = true
34
+ disable_on_external_context = true
35
+
36
+ [mcp_servers.codegraph]
37
+ command = "codegraph"
38
+ args = ["serve", "--mcp"]
package/dist/src/cli.js CHANGED
@@ -10,18 +10,20 @@ import { registerDimensionAnalyzeCommand } from "./commands/dimension-analyze.js
10
10
  import { registerDoctorCommand } from "./commands/doctor.js";
11
11
  import { registerIpCommand } from "./commands/ip.js";
12
12
  import { registerKnowledgeCommand } from "./commands/knowledge.js";
13
+ import { registerNamingCommand } from "./commands/naming.js";
13
14
  import { registerObfuscateCommand } from "./commands/obfuscate.js";
14
15
  import { registerScanCommand } from "./commands/scan.js";
15
16
  import { registerScanBatchCommand } from "./commands/scan-batch.js";
16
17
  import { registerScreenshotsCommand } from "./commands/screenshots.js";
17
18
  import { registerSchemaCommand } from "./commands/schema.js";
18
19
  import { registerSmokeCommand } from "./commands/smoke.js";
20
+ import { registerSetupCommand } from "./commands/setup.js";
19
21
  import { registerUploadCommand } from "./commands/upload.js";
20
22
  const program = new Command();
21
23
  program
22
24
  .name("ipa-cli")
23
25
  .description("检查 IPA 的提审风险信号与相似性指标。")
24
- .version("0.2.4")
26
+ .version("0.2.5")
25
27
  .showHelpAfterError();
26
28
  registerAnalyzeCommand(program);
27
29
  registerActionsCommand(program);
@@ -33,6 +35,7 @@ registerDimensionAnalyzeCommand(program);
33
35
  registerDoctorCommand(program);
34
36
  registerIpCommand(program);
35
37
  registerKnowledgeCommand(program);
38
+ registerNamingCommand(program);
36
39
  registerObfuscateCommand(program);
37
40
  registerScanCommand(program);
38
41
  registerScanBatchCommand(program);
@@ -40,6 +43,7 @@ registerScreenshotsCommand(program);
40
43
  registerSchemaCommand(program);
41
44
  registerSmokeCommand(program);
42
45
  registerBaselineCommand(program);
46
+ registerSetupCommand(program);
43
47
  registerUploadCommand(program);
44
48
  await program.parseAsync(normalizeLegacyArgv(process.argv));
45
49
  function normalizeLegacyArgv(argv) {
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,+BAA+B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE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export declare function registerNamingCommand(program: Command): void;
@@ -0,0 +1,51 @@
1
+ import { generateRandomNamingEntries } from "../core/naming.js";
2
+ import { formatPanel } from "../core/reporting/terminal.js";
3
+ export function registerNamingCommand(program) {
4
+ program
5
+ .command("naming")
6
+ .description("随机生成包名与英文应用项目名。")
7
+ .option("--count <n>", "生成数量,默认 1", "1")
8
+ .option("--prefix <prefix>", "bundle 前缀,默认 com", "com")
9
+ .option("--format <format>", "输出格式:text|json", "text")
10
+ .action(async (options) => {
11
+ const format = normalizeFormat(options.format);
12
+ const count = normalizePositiveInteger(options.count, 1);
13
+ const items = generateRandomNamingEntries({
14
+ count,
15
+ prefix: options.prefix
16
+ });
17
+ if (format === "json") {
18
+ process.stdout.write(`${JSON.stringify({
19
+ count,
20
+ items
21
+ }, null, 2)}\n`);
22
+ return;
23
+ }
24
+ process.stdout.write(`${renderNamingText(items)}\n`);
25
+ });
26
+ }
27
+ function renderNamingText(items) {
28
+ return items
29
+ .map((item, index) => formatPanel(items.length === 1 ? "随机命名" : `随机命名 #${index + 1}`, [
30
+ ["Bundle ID", item.bundleId],
31
+ ["Project Name", item.projectName]
32
+ ]))
33
+ .join("\n\n");
34
+ }
35
+ function normalizeFormat(value) {
36
+ if (value === "json") {
37
+ return "json";
38
+ }
39
+ return "text";
40
+ }
41
+ function normalizePositiveInteger(value, fallback) {
42
+ if (!value) {
43
+ return fallback;
44
+ }
45
+ const parsed = Number.parseInt(value, 10);
46
+ if (!Number.isInteger(parsed) || parsed <= 0) {
47
+ throw new Error(`count 必须是正整数: ${value}`);
48
+ }
49
+ return parsed;
50
+ }
51
+ //# sourceMappingURL=naming.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"naming.js","sourceRoot":"","sources":["../../../src/commands/naming.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,2BAA2B,EAA0B,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAU5D,MAAM,UAAU,qBA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;KACnC,CAAC,CACH;SACA,IAAI,CAAC,MAAM,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,eAAe,CAAC,KAAa;IACpC,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QACrB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAyB,EAAE,QAAgB;IAC3E,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,iBAAiB,KAAK,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Command } from "commander";
2
+ export declare function registerSetupCommand(program: Command): void;
@@ -0,0 +1,32 @@
1
+ import { renderSetupReport, setupMachineEnvironment } from "../core/setup.js";
2
+ export function registerSetupCommand(program) {
3
+ const setup = program.command("setup").description("初始化新机器上的 Codex / Claude / CodeGraph / RTK 及全局 skills。");
4
+ setup
5
+ .command("init")
6
+ .description("一键安装缺失工具,并合并全局 skills / 插件快照;已有工具不覆盖原配置。")
7
+ .option("--dry-run", "只输出计划,不执行安装或写文件", false)
8
+ .option("--format <format>", "输出格式:text|json", "text")
9
+ .action(async (options) => {
10
+ const format = normalizeSetupFormat(options.format);
11
+ const report = await setupMachineEnvironment({
12
+ dryRun: options.dryRun ?? false,
13
+ format
14
+ });
15
+ if (format === "json") {
16
+ process.stdout.write(`${JSON.stringify(report, null, 2)}\n`);
17
+ }
18
+ else {
19
+ process.stdout.write(`${renderSetupReport(report)}\n`);
20
+ }
21
+ if (report.tools.some((tool) => tool.action === "failed")) {
22
+ process.exitCode = 1;
23
+ }
24
+ });
25
+ }
26
+ function normalizeSetupFormat(value) {
27
+ if (value === "text" || value === "json") {
28
+ return value;
29
+ }
30
+ throw new Error(`不支持的 setup 输出格式: ${value}`);
31
+ }
32
+ //# sourceMappingURL=setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/commands/setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAoB,MAAM,kBAAkB,CAAC;AAOhG,MAAM,UAAU,oBAAoB,CAAC,OAAgB;IACnD,MAAM,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,uDAAuD,CAAC,CAAC;IAE5G,KAAK;SACF,OAAO,CAAC,MAAM,CAAC;SACf,WAAW,CAAC,0CAA0C,CAAC;SACvD,MAAM,CAAC,WAAW,EAAE,iBAAiB,EAAE,KAAK,CAAC;SAC7C,MAAM,CAAC,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,CAAC;SACrD,MAAM,CAAC,KAAK,EAAE,OAAgC,EAAE,EAAE;QACjD,MAAM,MAAM,GAAG,oBAAoB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,MAAM,uBAAuB,CAAC;YAC3C,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,KAAK;YAC/B,MAAM;SACP,CAAC,CAAC;QAEH,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACzD,CAAC;QAED,IAAI,MAAM,CAAC,KAAK,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